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
Thanks for your great work, here is an error when I try to use the model as given in the model zoo on iNaturalist data set. The model is based on ResNet50 backbone with 4 experts and distillation. When I try to use the model as the pretrained model to initialize the model during stage 2. It produces the following errors. It seems that the parameters of some layers are not well loaded.
My command lines are:
python train.py -c "configs/config_iNaturalist_resnet50_ride_ea.json" -r afs/RIDE/RIDE_model/imagenet_4experts_distill/checkpoint-epoch5.pth --reduce_dimension 1 --num_experts 4
The reported errors are as follows:
Loading checkpoint: ./RIDE/RIDE_model/imagenet_4experts_distill/checkpoint-epoch5.pth ...
Traceback (most recent call last):
File "/root/workspace/env_run/utils/util.py", line 59, in load_state_dict
own_state["module."+name].copy_(param)
RuntimeError: The size of tensor a (64) must match the size of tensor b (128) at non-singleton dimension 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 110, in
main(config)
File "train.py", line 73, in main
lr_scheduler=lr_scheduler)
File "/root/workspace/env_run/trainer/trainer.py", line 14, in init
super().init(model, criterion, metric_ftns, optimizer, config)
File "/root/workspace/env_run/base/base_trainer.py", line 59, in init
self._resume_checkpoint(config.resume, state_dict_only=state_dict_only)
File "/root/workspace/env_run/base/base_trainer.py", line 211, in _resume_checkpoint
load_state_dict(self.model, state_dict)
File "/root/workspace/env_run/utils/util.py", line 63, in load_state_dict
print("Error in copying parameter {}, source shape: {}, destination shape: {}".format(name, param.shape, own_sta
te[name].shape))
KeyError: 'backbone.layer1.0.conv1.weight'
The text was updated successfully, but these errors were encountered:
There is a size mismatch between the models. As you can see, you are trying to load an ImageNet checkpoint, but config is iNaturalist. You could probably have a look into model you are using and the checkpoint you are using.
The error:
The size of tensor a (64) must match the size of tensor b (128) at non-singleton dimension 0
Thanks for your great work, here is an error when I try to use the model as given in the model zoo on iNaturalist data set. The model is based on ResNet50 backbone with 4 experts and distillation. When I try to use the model as the pretrained model to initialize the model during stage 2. It produces the following errors. It seems that the parameters of some layers are not well loaded.
My command lines are:
python train.py -c "configs/config_iNaturalist_resnet50_ride_ea.json" -r afs/RIDE/RIDE_model/imagenet_4experts_distill/checkpoint-epoch5.pth --reduce_dimension 1 --num_experts 4
The reported errors are as follows:
Loading checkpoint: ./RIDE/RIDE_model/imagenet_4experts_distill/checkpoint-epoch5.pth ...
Traceback (most recent call last):
File "/root/workspace/env_run/utils/util.py", line 59, in load_state_dict
own_state["module."+name].copy_(param)
RuntimeError: The size of tensor a (64) must match the size of tensor b (128) at non-singleton dimension 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 110, in
main(config)
File "train.py", line 73, in main
lr_scheduler=lr_scheduler)
File "/root/workspace/env_run/trainer/trainer.py", line 14, in init
super().init(model, criterion, metric_ftns, optimizer, config)
File "/root/workspace/env_run/base/base_trainer.py", line 59, in init
self._resume_checkpoint(config.resume, state_dict_only=state_dict_only)
File "/root/workspace/env_run/base/base_trainer.py", line 211, in _resume_checkpoint
load_state_dict(self.model, state_dict)
File "/root/workspace/env_run/utils/util.py", line 63, in load_state_dict
print("Error in copying parameter {}, source shape: {}, destination shape: {}".format(name, param.shape, own_sta
te[name].shape))
KeyError: 'backbone.layer1.0.conv1.weight'
The text was updated successfully, but these errors were encountered: