example/resnet_pytorch_to_caffe.py
Opened this issue · 2 comments
lfydegithub commented
...
fc
fc1 was added to layers
139990017089184:fc_blob1 was added to blobs
Add blob fc_blob1 : torch.Size([1, 1000])
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/ubuntu/pycharm-community-2019.2.3/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/home/ubuntu/pycharm-community-2019.2.3/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/ubuntu/workspace/pyspace/holo_det/projects/keypoints/convert_pytorch_to_caffe/example_resnet_pytorch_to_caffe.py", line 18, in <module>
pytorch_to_caffe.trans_net(resnet18, input, name)
File "./pytorch_to_caffe.py", line 663, in trans_net
out = net.forward(input_var)
File "/home/ubuntu/anaconda3/envs/det2/lib/python3.6/site-packages/torchvision/models/resnet.py", line 208, in forward
x = self.fc(x)
File "/home/ubuntu/anaconda3/envs/det2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/ubuntu/anaconda3/envs/det2/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)
File "./pytorch_to_caffe.py", line 582, in __call__
out=self.obj(self.raw,*args,**kwargs)
File "./pytorch_to_caffe.py", line 135, in _linear
bottom=[log.blobs(input)],top=top_blobs)
File "./pytorch_to_caffe.py", line 88, in blobs
print("{}:{} getting".format(var, self._blobs[var]))
File "./pytorch_to_caffe.py", line 31, in __getitem__
return self.data[key]
KeyError: 139990017089112
something wrong with fc layer
gyy-bot commented
I have the same problem as you. Have you solved it?
gyy-bot commented
@lfydegithub
I solved the problem. I changed the pytorch version to 1.0, it can run successfully.