Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example fails #68

Open
neilyoung opened this issue Feb 5, 2020 · 10 comments
Open

Example fails #68

neilyoung opened this issue Feb 5, 2020 · 10 comments

Comments

@neilyoung
Copy link

neilyoung commented Feb 5, 2020

Did run resnet_pytorch_2_caffe.pywith a downloaded resnet18-5c106cde.pth. Went good for a while, then it crashed:


744513648:fc_blob1 was added to blobs
WARNING: CANNOT FOUND blob 4744513488
Traceback (most recent call last):
  File "./example/test.py", line 17, in <module>
    pytorch_to_caffe.trans_net(resnet18,input,name)
  File "./pytorch_to_caffe.py", line 775, in trans_net
    out = net.forward(input_var)
  File "/usr/local/lib/python3.7/site-packages/torchvision/models/resnet.py", line 208, in forward
    x = self.fc(x)
  File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.7/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 678, in __call__
    out=self.obj(self.raw,*args,**kwargs)
  File "./pytorch_to_caffe.py", line 138, in _linear
    bottom=[log.blobs(input)],top=top_blobs)
  File "./Caffe/layer_param.py", line 33, in __init__
    self.bottom.extend(bottom)
TypeError: None has type NoneType, but expected one of: bytes, unicode

Any pointer?

@yaoqi-zd
Copy link

@neilyoung Hi, I meet the same problem, have you solved it?

@neilyoung
Copy link
Author

TBH, I don't recall

@zhangchuanyi96
Copy link

Same error, need help

@holdfire
Copy link

holdfire commented Jul 6, 2020

@neilyoung @yaoqi-zd @zhangchuanyi96 I met the same problem as you guys. I solved this in pytorch 1.0 environment.

@zhangchuanyi96
Copy link

@neilyoung @yaoqi-zd @zhangchuanyi96 I met the same problem as you guys. I solved this in pytorch 1.0 environment.

Thanks. BTW, I have managed to tackle it by replacing 'flatten' with 'view'.

@yanty123
Copy link

@zhangchuanyi96 hello bro, i have fix it with view() as you say, however, i have met a new question when i load the caffe model.

It says: 'F0711 16:12:40.803625 10250 insert_splits.cpp:29] Unknown bottom blob 'contiguous_blob1' (layer 'view1', bottom index 0)'
So how can i fix the new bug?

@zhangchuanyi96
Copy link

@zhangchuanyi96 hello bro, i have fix it with view() as you say, however, i have met a new question when i load the caffe model.

It says: 'F0711 16:12:40.803625 10250 insert_splits.cpp:29] Unknown bottom blob 'contiguous_blob1' (layer 'view1', bottom index 0)'
So how can i fix the new bug?

I didn't meet this bug and can't help. Maybe changing pytorch version will help, like 1.0

@imistyrain
Copy link

这是由于0.3之后的trochvision将view换成flatten层的转换未实现所致,你可以参考#26

@zhangchuanyi96
Copy link

这是由于0.3之后的trochvision将view换成flatten层的转换未实现所致,你可以参考#26

谢谢回复

@FunnyExplorer
Copy link

I change to torch==1.0.1 torchvision==0.2.2, which can solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants