You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我使用的命令是python test.py --gpu 0 --workdir ./output --model sparenet --weights ./ckpt/SpareNet.pth--test_mode default
下面是我截取的一小段报错:
Traceback (most recent call last):
File "test.py", line 80, in
main()
File "test.py", line 74, in main
model = getattr(module, args.model + "Runner")(cfg, logger)
File "/media/jsj/1E44E67244E64C59/jsc/SpareNet/runners/sparenet_runner.py", line 19, in init
super().init(config, logger)
File "/media/jsj/1E44E67244E64C59/jsc/SpareNet/runners/base_runner.py", line 79, in init
self.models_load()
File "/media/jsj/1E44E67244E64C59/jsc/SpareNet/runners/base_runner.py", line 108, in models_load
self.init_epoch, self.best_metrics = um.model_load(self.config, self.models)
File "/media/jsj/1E44E67244E64C59/jsc/SpareNet/utils/misc.py", line 75, in model_load
net_G.load_state_dict(checkpoint["net_G"]) # change into net_G!!
File "/home/jsj/anaconda3/envs/jsc/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1605, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DataParallel:
Unexpected key(s) in state_dict: "module.encoder.feat_extractor.se1.fc.0.weight", "module.encoder.feat_extractor.se1.fc.2.weight",
Activity
AlphaPav commentedon Mar 22, 2024
您好,
可能是版本问题, 请问您的torch版本是什么? 可参考requirements.txt里的版本.