GithubHelp home page GithubHelp logo

Comments (11)

tianzhi0549 avatar tianzhi0549 commented on June 30, 2024

@ZhengMengbin Please download the model here https://cloudstor.aarnet.edu.au/plus/s/k3ys35075jmU1RP/download.

from fcos.

ZhengMengbin avatar ZhengMengbin commented on June 30, 2024

I use the pre-trained model from https://cloudstor.aarnet.edu.au/plus/s/k3ys35075jmU1RP/download, but it happens an another error:
'File "tools/train_net.py", line 175, in
main()
File "tools/train_net.py", line 168, in main
model = train(cfg, args.local_rank, args.distributed)
File "tools/train_net.py", line 54, in train
extra_checkpoint_data = checkpointer.load(cfg.MODEL.WEIGHT)
File "/home/zhengchenbin/FcosNet/FCOS/maskrcnn_benchmark/utils/checkpoint.py", line 65, in load
checkpoint = self._load_file(f)
File "/home/zhengchenbin/FcosNet/FCOS/maskrcnn_benchmark/utils/checkpoint.py", line 138, in _load_file
return load_c2_format(self.cfg, f)
File "/home/zhengchenbin/FcosNet/FCOS/maskrcnn_benchmark/utils/c2_model_loading.py", line 175, in load_c2_format
return C2_FORMAT_LOADER[cfg.MODEL.BACKBONE.CONV_BODY](cfg, f)
File "/home/zhengchenbin/FcosNet/FCOS/maskrcnn_benchmark/utils/c2_model_loading.py", line 170, in load_resnet_c2_format
state_dict = _rename_weights_for_resnet(state_dict, stages)
File "/home/zhengchenbin/FcosNet/FCOS/maskrcnn_benchmark/utils/c2_model_loading.py", line 124, in _rename_weights_for_resnet
w = torch.from_numpy(v)
TypeError: expected np.ndarray (got str)'
It seems this pre-trained model do not the same model from https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/20171220/X-101-64x4d.pkl.

from fcos.

tianzhi0549 avatar tianzhi0549 commented on June 30, 2024

@ZhengMengbin Please add the following code

if 'weight_order' in k:
    continue

to

.
It will skip the key weight_order.

from fcos.

ZhengMengbin avatar ZhengMengbin commented on June 30, 2024

It works, thank you very much for your reply! I will close this issue.

from fcos.

ZhengMengbin avatar ZhengMengbin commented on June 30, 2024

I have another question, I download the trained model FCOS_X_101_64x4d_FPN_2x, its size is only 361.5M, but I use the pre-trained model from https://cloudstor.aarnet.edu.au/plus/s/k3ys35075jmU1RP/download(the pre-trained model's size is 667.7M), the saved model's size is 687M, why is the size gap so large?
image
image

from fcos.

tianzhi0549 avatar tianzhi0549 commented on June 30, 2024

@ZhengMengbin We remove all solver states for our released models.

from fcos.

ZhengMengbin avatar ZhengMengbin commented on June 30, 2024

Is it convenient to provide a script file for removing all the solver states?

from fcos.

tianzhi0549 avatar tianzhi0549 commented on June 30, 2024

@ZhengMengbin We will add the script into our code when we have time. For now, you can use torch.load to load the model and then delete what you don't want. Next, you can use torch.save to save the pruned model.

from fcos.

ZhengMengbin avatar ZhengMengbin commented on June 30, 2024

OK, special thanks, I will try it.

from fcos.

ZhengMengbin avatar ZhengMengbin commented on June 30, 2024

I use the code as follows to remove all the solver states:
image
Using the above code, I got the same model size as the author.

from fcos.

tianzhi0549 avatar tianzhi0549 commented on June 30, 2024

@ZhengMengbin Thank you very much for posting it.

from fcos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.