Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

测试过程中的问题 #77

Open
xyl-507 opened this issue Nov 16, 2021 · 13 comments
Open

测试过程中的问题 #77

xyl-507 opened this issue Nov 16, 2021 · 13 comments

Comments

@xyl-507
Copy link

xyl-507 commented Nov 16, 2021

作者您好:

感谢你们的杰出贡献。最近在复现你们的代码过程中出现一个问题。我用pysot的环境(torch==0.4)来跑您们的代码,训练完成之后,只有19个checkpoint,并且在resumetest的过程中,在加载模型时都出现了assertion error

(pysot) xyl@xyl-System-Product-Name:~/SiamCAR-master/experiments/siamcar_mobilenetv2$ python -u ../../tools/test.py --snapshot snapshot/checkpoint_e8.pth --config config.yaml --dataset UAV123
Traceback (most recent call last):
File "../../tools/test.py", line 127, in
main()
File "../../tools/test.py", line 61, in main
model = load_pretrain(model, args.snapshot).cuda().eval()
File "/home/xyl/SiamCAR-master/pysot/utils/model_load.py", line 51, in load_pretrain
map_location=lambda storage, loc: storage.cuda(device))
File "/home/xyl/anaconda3/envs/pysot/lib/python3.7/site-packages/torch/serialization.py", line 358, in load
return _load(f, map_location, pickle_module)
File "/home/xyl/anaconda3/envs/pysot/lib/python3.7/site-packages/torch/serialization.py", line 548, in _load
assert key in deserialized_objects
AssertionError

请问一下:是不是因为代码环境不一样?可是我看你们的介绍说在torch==0.4的环境中也实现了。

@xyl-507
Copy link
Author

xyl-507 commented Nov 21, 2021

把torch换成1.2版本的确实可以测试了,成功运行。但现在一个问题就是,将backbone换成pysot中的mobilenetv2,训练过程没有出现问题,测试过程仍然报错:
assert key in deserialized_objects
AssertionError
请问一下,是出了什么问题吗?
@Capricorn231

@job333
Copy link

job333 commented Nov 30, 2021

你好,可以交流一下吗,我把backbone换成alexnet,测试过程也报错了。qq1824553806
loading UAV123: 100%|██████████████████████████████████| 123/123 [00:10<00:00, 12.11it/s, person4_1]
Traceback (most recent call last):
File "test.py", line 126, in
main()
File "test.py", line 90, in main
outputs = tracker.track(img, hp)
File "E:\siamese-rpn-pytorch\za\SiamCAR-master\pysot\tracker\siamcar_tracker.py", line 123, in track
outputs = self.model.track(x_crop)
File "E:\siamese-rpn-pytorch\za\SiamCAR-master\pysot\models\model_builder.py", line 55, in track
features = self.xcorr_depthwise(xf[0],self.zf[0])
File "E:\siamese-rpn-pytorch\za\SiamCAR-master\pysot\utils\xcorr.py", line 44, in xcorr_depthwise
x = x.view(1, batch*channel, x.size(2), x.size(3))
IndexError: Dimension out of range (expected to be in range of [-3, 2], but got 3)

@xyl-507
Copy link
Author

xyl-507 commented Dec 2, 2021

@job333 咱们的问题还不一样,你的模型已经加载成功了,我的在加载阶段就出错了。可能SiamCAR不支持更换主干网络把

@job333
Copy link

job333 commented Dec 2, 2021

加下qq,我上面发了,再探讨一下这个问题

@job333
Copy link

job333 commented Dec 2, 2021

@xyl-507

@WangJun-ZJUT
Copy link
Collaborator

你好,可以交流一下吗,我把backbone换成alexnet,测试过程也报错了。qq1824553806 loading UAV123: 100%|██████████████████████████████████| 123/123 [00:10<00:00, 12.11it/s, person4_1] Traceback (most recent call last): File "test.py", line 126, in main() File "test.py", line 90, in main outputs = tracker.track(img, hp) File "E:\siamese-rpn-pytorch\za\SiamCAR-master\pysot\tracker\siamcar_tracker.py", line 123, in track outputs = self.model.track(x_crop) File "E:\siamese-rpn-pytorch\za\SiamCAR-master\pysot\models\model_builder.py", line 55, in track features = self.xcorr_depthwise(xf[0],self.zf[0]) File "E:\siamese-rpn-pytorch\za\SiamCAR-master\pysot\utils\xcorr.py", line 44, in xcorr_depthwise x = x.view(1, batch*channel, x.size(2), x.size(3)) IndexError: Dimension out of range (expected to be in range of [-3, 2], but got 3)

您好!关于这个问题是因为在resnet中融合了多层特征,backbone返回的是多层特征的列表,更换成alexnet后返回的是tensor,所以索引上会差一个维度。

@job333
Copy link

job333 commented Dec 6, 2021

@WangJun-ZJUT 请教您这具体该怎么改,代码能力实在是差一些,感谢

@WangJun-ZJUT
Copy link
Collaborator

@WangJun-ZJUT 请教您这具体该怎么改,代码能力实在是差一些,感谢

您好,在alexnet的输出套一层list就可以了

@xyl-507
Copy link
Author

xyl-507 commented Dec 7, 2021

@WangJun-ZJUT 作者您好,请问一下换了mobilenetv2,训练可以,为什么测试会报错:
(pysot) xyl@xyl-System-Product-Name:~/SiamCAR-master/experiments/siamcar_mobilenetv2$ python -u ../../tools/test.py --snapshot snapshot/checkpoint_e8.pth --config config.yaml --dataset UAV123
Traceback (most recent call last):
File "../../tools/test.py", line 127, in
main()
File "../../tools/test.py", line 61, in main
model = load_pretrain(model, args.snapshot).cuda().eval()
File "/home/xyl/SiamCAR-master/pysot/utils/model_load.py", line 51, in load_pretrain
map_location=lambda storage, loc: storage.cuda(device))
File "/home/xyl/anaconda3/envs/pysot/lib/python3.7/site-packages/torch/serialization.py", line 358, in load
return _load(f, map_location, pickle_module)
File "/home/xyl/anaconda3/envs/pysot/lib/python3.7/site-packages/torch/serialization.py", line 548, in _load
assert key in deserialized_objects
AssertionError

@xyl-507
Copy link
Author

xyl-507 commented Apr 2, 2022

@WangJun-ZJUT 作者您好,我用resnet50为主干网络训练的siamcar在测试阶段只有checkpoint_e10,e15,e16,可以成功测试。其它的权重就会报错:
RuntimeError: storage has wrong size: expected 5754537876681439371 got 16384
or
ValueError: unsupported pickle protocol: 128
请问一下:这种是什么原因导致的?
十分感谢!!

@WangJun-ZJUT
Copy link
Collaborator

WangJun-ZJUT commented Apr 2, 2022 via email

@xyl-507
Copy link
Author

xyl-507 commented Apr 2, 2022 via email

@iYbei
Copy link

iYbei commented Apr 7, 2022

你好,我想问一下我在评估OTB100数据集上跑出来的结果出现了以下错误,是因为什么呢?跑出来的结果是100个txt文件
(base) at@at-RESCUER-R720-15IKBN:~/SiamCAR-master/tools$ python eval.py --tracker_path ./results --dataset OTB100 --tracker_prefix 'general_model'
Traceback (most recent call last):
File "eval.py", line 104, in
main()
File "eval.py", line 37, in main
assert len(trackers) > 0
AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants