Giter Site home page Giter Site logo

Comments (5)

JudasDie avatar JudasDie commented on August 18, 2024

Hi, Zhipeng, good job! Thanks for your kind release of this code. When I test the siamRPN with pre-trained model, however, I find the results is always lost even at the beginning. I wonder if you released the right version of the pretrained model? I see the following on my terminal:

python test_siamrpn.py
load pretrained model from ../snapshot/CIResNet22.pth
remove prefix 'module.'
missing keys:set(['connect_model.adjust.weight', 'connect_model.search_reg.bias', 'connect_model.search_cls.bias', 'connect_model.search_reg.weight', 'connect_model.template_reg.weight', 'connect_model.template_reg.bias', 'connect_model.search_cls.weight', 'connect_model.template_cls.bias', 'connect_model.template_cls.weight', 'connect_model.adjust.bias'])
unused checkpoint keys:set([u'connect_model.loc_adjust.weight', u'connect_model.loc_adjust.bias'])

Would you please kindly help to run the code succesfully? the code of SiamFC is OK (I tried). I used this setting for testing:

parser.add_argument('--arch', dest='arch', default='SiamRPNRes22', help='backbone architecture')
parser.add_argument('--resume', default='../snapshot/CIResNet22.pth', type=str, help='pretrained model')

Screenshot from 2019-07-01 19-32-03
Screenshot from 2019-07-01 19-33-03

Hi~ The pretrained model you used is not correct. You should use CIResNet22_RPN.pth for SiamRPN and CIResNet22.pth for SiamFC respectively. Try and give me a feedback pls.

from siamdw.

wangxiao5791509 avatar wangxiao5791509 commented on August 18, 2024

Thanks for your advice. I also tried "CIResNet22_RPN.pth", but it shown me the following error:

python test_siamrpn.py
load pretrained model from ../snapshot/CIResNet22_RPN.pth
remove prefix 'module.'
missing keys:set([])
unused checkpoint keys:set([u'features.features.layer2.2.bn1.num_batches_tracked', u'features.features.layer2.0.bn2.num_batches_tracked', u'features.features.layer2.3.bn2.num_batches_tracked', u'features.features.layer1.2.bn1.num_batches_tracked', u'features.features.layer1.1.bn3.num_batches_tracked', u'features.features.layer1.2.bn2.num_batches_tracked', u'features.features.layer2.4.bn2.num_batches_tracked', u'features.features.layer2.3.bn3.num_batches_tracked', u'features.features.layer1.0.bn1.num_batches_tracked', u'features.features.layer2.3.bn1.num_batches_tracked', u'features.features.layer2.2.bn3.num_batches_tracked', u'features.features.layer1.1.bn2.num_batches_tracked', u'features.features.layer2.0.bn3.num_batches_tracked', u'features.features.layer1.1.bn1.num_batches_tracked', u'features.features.layer2.2.bn2.num_batches_tracked', u'features.features.layer1.2.bn3.num_batches_tracked', u'features.features.layer1.0.downsample.1.num_batches_tracked', u'features.features.layer2.0.downsample.1.num_batches_tracked', u'features.features.layer2.4.bn3.num_batches_tracked', u'features.features.layer1.0.bn2.num_batches_tracked', u'features.features.bn1.num_batches_tracked', u'features.features.layer2.0.bn1.num_batches_tracked', u'features.features.layer2.4.bn1.num_batches_tracked', u'features.features.layer1.0.bn3.num_batches_tracked'])
Traceback (most recent call last):
File "test_siamrpn.py", line 317, in
main()
File "test_siamrpn.py", line 203, in main
net = load_pretrain(net, args.resume)
File "/media/wangxiao/49cd8079-e619-4e4b-89b1-15c86afb5102/my_works/SiamDW-master-revised/siamese_tracking/../lib/utils/utils.py", line 240, in load_pretrain
model.load_state_dict(pretrained_dict, strict=False)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 721, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for SiamRPNRes22:
While copying the parameter named "connect_model.template_cls.bias", whose dimensions in the model are torch.Size([5120]) and whose dimensions in the checkpoint are torch.Size([1280]).
While copying the parameter named "connect_model.template_cls.weight", whose dimensions in the model are torch.Size([5120, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([1280, 512, 3, 3]).
While copying the parameter named "connect_model.template_reg.bias", whose dimensions in the model are torch.Size([10240]) and whose dimensions in the checkpoint are torch.Size([5120]).
While copying the parameter named "connect_model.template_reg.weight", whose dimensions in the model are torch.Size([10240, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([5120, 512, 3, 3]).
While copying the parameter named "connect_model.search_cls.bias", whose dimensions in the model are torch.Size([512]) and whose dimensions in the checkpoint are torch.Size([256]).
While copying the parameter named "connect_model.search_cls.weight", whose dimensions in the model are torch.Size([512, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([256, 512, 3, 3]).
While copying the parameter named "connect_model.search_reg.bias", whose dimensions in the model are torch.Size([512]) and whose dimensions in the checkpoint are torch.Size([256]).
While copying the parameter named "connect_model.search_reg.weight", whose dimensions in the model are torch.Size([512, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([256, 512, 3, 3]).

from siamdw.

JudasDie avatar JudasDie commented on August 18, 2024

Thanks for your advice. I also tried "CIResNet22_RPN.pth", but it shown me the following error:

python test_siamrpn.py
load pretrained model from ../snapshot/CIResNet22_RPN.pth
remove prefix 'module.'
missing keys:set([])
unused checkpoint keys:set([u'features.features.layer2.2.bn1.num_batches_tracked', u'features.features.layer2.0.bn2.num_batches_tracked', u'features.features.layer2.3.bn2.num_batches_tracked', u'features.features.layer1.2.bn1.num_batches_tracked', u'features.features.layer1.1.bn3.num_batches_tracked', u'features.features.layer1.2.bn2.num_batches_tracked', u'features.features.layer2.4.bn2.num_batches_tracked', u'features.features.layer2.3.bn3.num_batches_tracked', u'features.features.layer1.0.bn1.num_batches_tracked', u'features.features.layer2.3.bn1.num_batches_tracked', u'features.features.layer2.2.bn3.num_batches_tracked', u'features.features.layer1.1.bn2.num_batches_tracked', u'features.features.layer2.0.bn3.num_batches_tracked', u'features.features.layer1.1.bn1.num_batches_tracked', u'features.features.layer2.2.bn2.num_batches_tracked', u'features.features.layer1.2.bn3.num_batches_tracked', u'features.features.layer1.0.downsample.1.num_batches_tracked', u'features.features.layer2.0.downsample.1.num_batches_tracked', u'features.features.layer2.4.bn3.num_batches_tracked', u'features.features.layer1.0.bn2.num_batches_tracked', u'features.features.bn1.num_batches_tracked', u'features.features.layer2.0.bn1.num_batches_tracked', u'features.features.layer2.4.bn1.num_batches_tracked', u'features.features.layer1.0.bn3.num_batches_tracked'])
Traceback (most recent call last):
File "test_siamrpn.py", line 317, in
main()
File "test_siamrpn.py", line 203, in main
net = load_pretrain(net, args.resume)
File "/media/wangxiao/49cd8079-e619-4e4b-89b1-15c86afb5102/my_works/SiamDW-master-revised/siamese_tracking/../lib/utils/utils.py", line 240, in load_pretrain
model.load_state_dict(pretrained_dict, strict=False)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 721, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for SiamRPNRes22:
While copying the parameter named "connect_model.template_cls.bias", whose dimensions in the model are torch.Size([5120]) and whose dimensions in the checkpoint are torch.Size([1280]).
While copying the parameter named "connect_model.template_cls.weight", whose dimensions in the model are torch.Size([5120, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([1280, 512, 3, 3]).
While copying the parameter named "connect_model.template_reg.bias", whose dimensions in the model are torch.Size([10240]) and whose dimensions in the checkpoint are torch.Size([5120]).
While copying the parameter named "connect_model.template_reg.weight", whose dimensions in the model are torch.Size([10240, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([5120, 512, 3, 3]).
While copying the parameter named "connect_model.search_cls.bias", whose dimensions in the model are torch.Size([512]) and whose dimensions in the checkpoint are torch.Size([256]).
While copying the parameter named "connect_model.search_cls.weight", whose dimensions in the model are torch.Size([512, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([256, 512, 3, 3]).
While copying the parameter named "connect_model.search_reg.bias", whose dimensions in the model are torch.Size([512]) and whose dimensions in the checkpoint are torch.Size([256]).
While copying the parameter named "connect_model.search_reg.weight", whose dimensions in the model are torch.Size([512, 512, 3, 3]) and whose dimensions in the checkpoint are torch.Size([256, 512, 3, 3]).

  1. Please install packages with install_rpn.sh.
  2. Make sure that the input cls_type is thinner.

from siamdw.

wangxiao5791509 avatar wangxiao5791509 commented on August 18, 2024

@JudasDie Thanks for your suggestions. It's working now (Only "thinner" works for my setting). May I add your wechat? Maybe we can have some cooperations later. It's ok if you do not want to be troubled. My wechat is: wangxiao5791509.

from siamdw.

JudasDie avatar JudasDie commented on August 18, 2024

@JudasDie Thanks for your suggestions. It's working now (Only "thinner" works for my setting). May I add your wechat? Maybe we can have some cooperations later. It's ok if you do not want to be troubled. My wechat is: wangxiao5791509.

Glad to know you make it. The question will be closed.

from siamdw.

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.