onnx / tutorials

Tutorials for creating and using ONNX models
Apache License 2.0
3.34k stars 626 forks source link

Downloaded models have no effect in iOS app #116

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi,

in the "ONNXLive Tutorial" it is stated that the downloaded models can be added to the Xcode project and then being used for style transfer. However, when using these models, no changes of the captured images are visible. Downloading another network from https://github.com/kirualex/NSTDemo/blob/master/NSTDemo/StarryNight.mlmodel and using that network demonstrates that the app work correctly and style transfer is visible.

What I found so far:

  1. The input/output shapes might be related. For the working network they are Image (Color 720 x 720). For the network from the tutorial the input is MultiArray (Float32 3 x 540 x 250) while the output is Image (Color 252 x 540).

  2. I already applied the fix suggested https://github.com/onnx/tutorials/issues/89 with respect to the wrong output name.

  3. I read a lot about problems when using pytorch 1.0 with onnx-coreml, e.g. https://github.com/onnx/onnx-coreml/issues/365, but am not sure if this is related.

  4. I verified that the same problem occurs when I train my own models as described in the tutorial instead of using the downloaded models.

My setting

pytorch 1.0.1 onnx-coreml 0.4.0 onnx 1.4.1

Does anybody have an idea how to approach this problem?

Thanks, Thorsten

ghost commented 5 years ago

P.S. I should mention that the models by themselves seem to be ok. When I evaluate the pth models using the neural_style.py eval mentioned in the tutorial, the output looks as expected.