Open HiIcy opened 5 years ago
you should use torch == 0.3.1 and torchvision == 0.2.1
you should use torch == 0.3.1 and torchvision == 0.2.1
I'm sorry to reply you! Okay,I'll try it ,thank you!
For higher version pytorch > 0.3.1,you can change code to convert checkpoint to avoid this error.
For example, you chose BNInception, so find tf_model_zoo\bninception\pytorch_load.py code in init function
state_dict = torch.utils.model_zoo.load_url(weight_url) state_dict = self.convert_state_dict(state_dict) self.load_state_dict(state_dict)
then add a function after init function
`def convert_state_dict(self, state_dict):
cv_state_dict = {}
for key in state_dict:
current_tensor = state_dict[key]
if current_tensor.dim() == 2:
cv_state_dict[key] = current_tensor.squeeze()
else:
cv_state_dict[key] = current_tensor
return cv_state_dict`
then can solve this with higher version pytorch
I have pre-download
bn_inception.pth
,and part of error info as follow:I couldn't know how to solve it ,appreciate any help!