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
我想将代码移植到mmengine 2.*版本,但是mmengine中取消了MMDataParallel, 我换成了torch.nn.DataParallel.
在加载模型的时候会报错: File "./tools/train.py", line 104, in
main()
File "./tools/train.py", line 100, in main
runner.train()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1748, in train
self._init_model_weights()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 923, in _init_model_weights
model.init_weights()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_module.py", line 136, in init_weights
m.init_weights()
File "/root/mmseg/mmseg/models/backbones/vit_bimla.py", line 339, in init_weights
load_pretrained(self, num_classes=self.num_classes, in_chans=self.in_chans, pos_embed_interp=self.pos_embed_interp, num_patches=self.patch_embed.num_patches, align_corners=self.align_corners)
File "/root/mmseg/mmseg/models/backbones/helpers.py", line 60, in load_pretrained
state_dict = torch.load(cfg['pretrained_finetune'])
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 938, in _legacy_load
typed_storage._storage._set_from_file(
RuntimeError: storage has wrong byte size: expected %ld got %ld04096
加载的是pretrain/jx_vit_large_p16_384-b3be5167.pth
The text was updated successfully, but these errors were encountered:
我想将代码移植到mmengine 2.*版本,但是mmengine中取消了MMDataParallel, 我换成了torch.nn.DataParallel.
在加载模型的时候会报错: File "./tools/train.py", line 104, in
main()
File "./tools/train.py", line 100, in main
runner.train()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1748, in train
self._init_model_weights()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/runner/runner.py", line 923, in _init_model_weights
model.init_weights()
File "/root/miniconda3/lib/python3.8/site-packages/mmengine/model/base_module.py", line 136, in init_weights
m.init_weights()
File "/root/mmseg/mmseg/models/backbones/vit_bimla.py", line 339, in init_weights
load_pretrained(self, num_classes=self.num_classes, in_chans=self.in_chans, pos_embed_interp=self.pos_embed_interp, num_patches=self.patch_embed.num_patches, align_corners=self.align_corners)
File "/root/mmseg/mmseg/models/backbones/helpers.py", line 60, in load_pretrained
state_dict = torch.load(cfg['pretrained_finetune'])
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 938, in _legacy_load
typed_storage._storage._set_from_file(
RuntimeError: storage has wrong byte size: expected %ld got %ld04096
加载的是pretrain/jx_vit_large_p16_384-b3be5167.pth
The text was updated successfully, but these errors were encountered: