XinyuSun / SVFormer

Fork from SVFormer
Other
1 stars 0 forks source link

预训练模型对不上 #2

Open cocowkj opened 6 months ago

cocowkj commented 6 months ago

Traceback (most recent call last): File "run_net_emamix.py", line 44, in main() File "run_net_emamix.py", line 33, in main launch_job(cfg=cfg, init_method=args.init_method, func=test) File "/data1/yrx/SVFormer-main2/timesformer/utils/misc.py", line 297, in launch_job daemon=daemon, File "/data1/yrx/anaconda3/envs/svformer/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 199, in spawn return start_processes(fn, args, nprocs, join, daemon, start_method='spawn') File "/data1/yrx/anaconda3/envs/svformer/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 157, in start_processes while not context.join(): File "/data1/yrx/anaconda3/envs/svformer/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 118, in join raise Exception(msg) Exception:

-- Process 0 terminated with the following error: Traceback (most recent call last): File "/data1/yrx/anaconda3/envs/svformer/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 19, in _wrap fn(i, *args) File "/data1/yrx/SVFormer-main2/timesformer/utils/multiprocessing.py", line 59, in run ret = func(cfg) File "/data1/yrx/SVFormer-main2/tools/test_net_base.py", line 166, in test model = build_model(cfg) File "/data1/yrx/SVFormer-main2/timesformer/models/build.py", line 36, in build_model model = MODEL_REGISTRY.get(name)(cfg) File "/data1/yrx/SVFormer-main2/timesformer/models/vit.py", line 598, in init load_pretrained(self.model, num_classes=self.model.num_classes, in_chans=kwargs.get('in_chans', 3), filter_fn=_conv_filter, img_size=cfg.DATA.TRAIN_CROP_SIZE, num_patches=self.num_patches, attention_type=self.attention_type, pretrained_model=pretrained_model) File "/data1/yrx/SVFormer-main2/timesformer/models/helpers.py", line 167, in load_pretrained del state_dict[classifier_name + '.weight'] KeyError: 'head.weight'