-
Notifications
You must be signed in to change notification settings - Fork 225
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
None has type NoneType, but expected one of: bytes, unicode #26
Comments
hi, I have met same problem, can you tell how to solve it, thank you |
Hi ,I also have met this problem,Can you tell me how to solve it. thank you |
Haaaaaa ,I also have met this problem.So, what can we do? |
please check your pytorch layer, confirm whether the layer you used is supported in this tool, some operation need change your writing, such as change torch.add to0 "torch.add" |
That's right, I have found some layers that are not supported. |
@xingyueye I want to convert a model containing DCN, how should I add DCN layer register on this tools? |
@peyer Sorry, I have no experience in converting DCN and can't give you advice. |
Same problem message here... torch 1.3.1 What I ran is the official example python example/alexnet_pytorch_to_caffe.py Got result output:
|
By switching to python3.6 and related packages, I can run it corectly. You may just name: py36_pytorch041
channels:
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- ca-certificates=2019.10.16=0
- certifi=2019.9.11=py36_0
- libedit=3.1.20181209=hc058e9b_0
- libffi=3.2.1=hd88cf55_4
- libgcc-ng=9.1.0=hdf63c60_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- ncurses=6.1=he6710b0_1
- openssl=1.1.1d=h7b6447c_3
- pip=19.3.1=py36_0
- python=3.6.9=h265db76_0
- readline=7.0=h7b6447c_5
- setuptools=41.6.0=py36_0
- sqlite=3.30.1=h7b6447c_0
- tk=8.6.8=hbc83047_0
- wheel=0.33.6=py36_0
- xz=5.2.4=h14c3975_4
- zlib=1.2.11=h7b6447c_3
- pip:
- cycler==0.10.0
- decorator==4.4.1
- imageio==2.6.1
- kiwisolver==1.1.0
- matplotlib==3.1.1
- networkx==2.4
- numpy==1.17.2
- opencv-python==3.3.1.11
- pillow==6.2.1
- protobuf==3.10.0
- pyparsing==2.4.5
- python-dateutil==2.8.1
- pywavelets==1.1.1
- scikit-image==0.15.0
- scipy==1.3.1
- six==1.13.0
- torch==0.4.1
- torchvision==0.2.1
prefix: /media/data1/hl/software/miniconda3/envs/py36_pytorch041 |
I created a virtual environment with your environment.yml file, I used python 3.6.0,is there anything else i need to convert the model. |
I met the same problem when using .view(), WARNING: CANNOT FOUND blob 140538514487648, should I change view() to something else? want to know how did you solve it |
If you are using pytorch version above or equal to 1.1. The conda solution wont work. In my conputer pytorch <=1.0.0 works perfectly while I update to 1.3 it gives an identical error shown above. |
Have you tried other environments? Such as 1.2 ,1.4 |
torchvision 0.3-0.5 doesn't work, roll backto 0.2 |
such as change torch.add to0 "torch.add" ?? some details ?? change torch.add to ???? |
谢谢,这完美的解决了我的问题。 |
How do you determine which layer operations are not supported,looking forward to your reply,thank you |
我torch改成1.4 ,torchvision改成0.2 ,还是报一样的错误.... |
出现这个错误的原因一般是当前层的上一层未做转换,blob未加入列表所致,调试下断点那就能找到. |
主要是0.2之后的版本将view改成了flatten操作,以alexnet为例
到了0.5变成了
其中的flatten并没有实现,搞清楚原因后解决就简单多了
然后替换pytorch中的实现,在那一堆torch.max=Rp(torch.max,_max)等骚操作后加上 |
Still getting that error with torch 1.8, torchvision 0.9 |
may be you should add net.eval() example: |
@Ronales 's advice worked for me. Added |
您的来信已收到,将会尽早做出答复,谢谢!
|
解决了!!太感谢了 |
您的来信已收到,将会尽早做出答复,谢谢!
|
convert from pytorch to caffe with own model,
WARNING: CANNOT FOUND blob 140437991457808
Traceback (most recent call last):
File "conver_rgb.py", line 49, in
convert(args)
File "conver_rgb.py", line 42, in convert
pytorch_to_caffe.trans_net(net, input_var, name)
File "/home/wangwenpeng/work/FaceAntiSpoofing_readsense_pytorch_patch/pytorch2caffe_MGN/convert/pytorch_to_caffe.py", line 459, in trans_net
out = net.forward(input_var)
File "convert/patch_attention_net.py", line 58, in forward
logit = logit.view(batch_size, -1)
File "/home/wangwenpeng/work/FaceAntiSpoofing_readsense_pytorch_patch/pytorch2caffe_MGN/convert/pytorch_to_caffe.py", line 297, in _view
bottom=[log.blobs(input)],top=top_blobs)
File "/home/wangwenpeng/work/FaceAntiSpoofing_readsense_pytorch_patch/pytorch2caffe_MGN/Caffe/layer_param.py", line 33, in init
self.bottom.extend(bottom)
TypeError: None has type NoneType, but expected one of: bytes, unicode
Anyone help? seems input blob error, but i show input shape ok before NET_INITTED=True in trans_net(), and error after NET_INITTED=True
The text was updated successfully, but these errors were encountered: