Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Error while trying to create coreml model #25

Closed
girginsoft opened this issue Jun 2, 2018 · 1 comment
Closed

Error while trying to create coreml model #25

girginsoft opened this issue Jun 2, 2018 · 1 comment

Comments

@girginsoft
Copy link

I have followed all the instructions to create a model from "http://cs.stanford.edu/people/jcjohns/fast-neural-style/models/instance_norm/mosaic.t7"
I have created my own style model, but when I tried to convert to coreml, I am getting this error.
I thought my model file is wrong, but I dowloaded this file "http://cs.stanford.edu/people/jcjohns/fast-neural-style/models/instance_norm/mosaic.t7" and tried with that. The result is same. No luck.
Could you provide me a solution to fix that?

Traceback (most recent call last):
File "convert-fast-neural-style.py", line 175, in
main()
File "convert-fast-neural-style.py", line 161, in main
unknown_layer_converter_fn=convert_instance_norm
File "/usr/local/lib/python2.7/dist-packages/torch2coreml/_torch_converter.py", line 192, in convert
with torch.legacy.nn.Sequential module as root"
TypeError: Model must be file path to .t7 file or pytorch loaded model with torch.legacy.nn.Sequential module as root

@girginsoft
Copy link
Author

I have found a solution, I am able to create core ml model by using this script. https://github.com/prisma-ai/torch2coreml/blob/master/example/fast-neural-style/prepare_model.lua

Thank you

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

No branches or pull requests

1 participant