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
When I run the last command to convert caffe model to pytorch model: "mmtomodel -f pytorch -in Pytorch_VGGFACE_IR.py -iw Pytorch_VGGFACE_IR.npy -o Pytorch_VGGFACE.pth", I met the following problem:
Traceback (most recent call last):
File "/root/anaconda3/bin/mmtomodel", line 10, in
sys.exit(_main())
File "/root/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/_script/dump_code.py", line 79, in _main
ret = dump_code(args.framework, args.inputNetwork, args.inputWeight, args.outputModel, args.dump_tag)
File "/root/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/_script/dump_code.py", line 32, in dump_code
save_model(MainModel, network_filepath, weight_filepath, dump_filepath)
File "/root/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/pytorch/saver.py", line 5, in save_model
model = MainModel.KitModel(weight_filepath)
File "Pytorch_VGGFACE_IR.py", line 27, in init
self.conv1_1 = self.__conv(2, name='conv1_1', in_channels=3, out_channels=64, kernel_size=(3, 3), stride=(1, 1), groups=1, bias=True)
File "Pytorch_VGGFACE_IR.py", line 129, in _conv
layer.state_dict()['bias'].copy(torch.from_numpy(__weights_dict[name]['bias']))
RuntimeError: output with shape [64] doesn't match the broadcast shape [1, 1, 1, 64]
Any ideas to solve this problem?
The text was updated successfully, but these errors were encountered:
change line 126 of Pytorch_VGGFACE_IR.py. Ref layer.state_dict()['bias'].copy_(torch.from_numpy(_weights_dict[name]['bias'])) -> layer.state_dict()['bias'].copy_(np.squeeze(torch.from_numpy(_weights_dict[name]['bias'])))
When I run the last command to convert caffe model to pytorch model: "mmtomodel -f pytorch -in Pytorch_VGGFACE_IR.py -iw Pytorch_VGGFACE_IR.npy -o Pytorch_VGGFACE.pth", I met the following problem:
Traceback (most recent call last):
File "/root/anaconda3/bin/mmtomodel", line 10, in
sys.exit(_main())
File "/root/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/_script/dump_code.py", line 79, in _main
ret = dump_code(args.framework, args.inputNetwork, args.inputWeight, args.outputModel, args.dump_tag)
File "/root/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/_script/dump_code.py", line 32, in dump_code
save_model(MainModel, network_filepath, weight_filepath, dump_filepath)
File "/root/anaconda3/lib/python3.7/site-packages/mmdnn/conversion/pytorch/saver.py", line 5, in save_model
model = MainModel.KitModel(weight_filepath)
File "Pytorch_VGGFACE_IR.py", line 27, in init
self.conv1_1 = self.__conv(2, name='conv1_1', in_channels=3, out_channels=64, kernel_size=(3, 3), stride=(1, 1), groups=1, bias=True)
File "Pytorch_VGGFACE_IR.py", line 129, in _conv
layer.state_dict()['bias'].copy(torch.from_numpy(__weights_dict[name]['bias']))
RuntimeError: output with shape [64] doesn't match the broadcast shape [1, 1, 1, 64]
Any ideas to solve this problem?
The text was updated successfully, but these errors were encountered: