-
Notifications
You must be signed in to change notification settings - Fork 966
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
AssertionError #324
Comments
even the sample model from mmdownload ca't work |
@jjaacckkyy63 You need to specify the input shape like --inputShape 3,224,224 |
Thank you for reply. |
If you are using pip package, the format is "3 224 224". (Sorry for the inconvenient and it will be changed in the coming new pip package). |
It helps! thank you |
No, all pytorch models need the shape. |
thanks, another issue occurs |
Hi @jjaacckkyy63 , please check if python can import torch.jit. Thanks! |
Hi, I'm a new guy to deep-learning |
Hi again, I finally fixed all the environment issue, $ mmconvert -sf pytorch --inputShape 1 224 224 -iw resnet18.pth -df keras --outputModel pytorch2keras.h5 Thank you |
Hi @sherlockblaze ,if you download model from collection, you can get the input shape here 'alexnet' : lambda path : TestKit.Standard(path, 227),
means
--inputShape 3,227,227 |
@namizzz Tks Very Much. I'll try it. |
Hi @jjaacckkyy63 ,thanks for your issue. We have fixed it. You can try the newest version. mmconvert -sf pytorch --inputShape 3,224,224 -iw ./imagenet_resnet152.pth -df keras --outputModel pytorch_test.h5
|
Hi, @namizzz mmconvert -sf pytorch --inputShape 3,224,224 -iw ./resnet152-b121ed2d.pth -df keras --outputModel pytorch_test.h5 |
Trying to convert resnet18 from Pytorch to Keras on MacOS:
Get an error:
Also input shape dim ordering should be in Pytorch format? |
Using it like this Give error:
What does it mean? |
Hi @mrgloom , I tried on Ubuntu. It works. |
@namizzz what command do you run? I use resnet18 from pytorch so 3,224,224 should be ok.
Also as we can see here it also 224. |
https://stackoverflow.com/a/52469645 Also I have printed structure of downloaded
|
However I fixed this problem with onnx #426 So I go the long way from IR to keras(according to this tutor https://github.com/Microsoft/MMdnn/tree/master/mmdnn/conversion/keras ):
But looks like it produce only
So my question is how to use this |
Hi @mrgloom , you are right! |
@sherlockblaze I've met the same problem as you, how can you fix it? would you pls do me a favor? |
Platform (like ubuntu 16.04/win10):
ubuntu 18.04
Python version:
3.6.5
Source framework with version (like Tensorflow 1.4.1 with GPU):
pytorch 0.4.0 with GPU
Destination framework with version (like CNTK 2.3 with GPU):
keras 2.2.0 with GPU
Running scripts:
mmconvert -sf pytorch -iw imagenet_inception_v3.pth -df keras -om p2k.h5
and give this error:
Traceback (most recent call last):
File "/home/ej/.local/bin/mmconvert", line 11, in
sys.exit(_main())
File "/home/ej/.local/lib/python3.6/site-packages/mmdnn/conversion/_script/convert.py", line 95, in _main
ret = convertToIR._convert(ir_args)
File "/home/ej/.local/lib/python3.6/site-packages/mmdnn/conversion/_script/convertToIR.py", line 73, in _convert
assert args.inputShape != None
AssertionError
The text was updated successfully, but these errors were encountered: