-
Notifications
You must be signed in to change notification settings - Fork 19
Description
我使用的命令是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",
尝试过修改 net_G.load_state_dict(checkpoint["net_G"],strict=False),但是输出效果很差,请问有什么好的办法吗