Add onnx support for InstanceNorm#4626
Conversation
74e65e9 to
d840c65
Compare
d840c65 to
ea90c81
Compare
|
Address #4584, it works end 2 end so far. But some unused tensors got exported, too. Will fix it soon. |
ea90c81 to
dad96d4
Compare
c865552 to
72f71e0
Compare
|
Please ignore the failed onnx-fb-universe CI, I already updated the expected files in onnxbot/onnx-fb-universe#268 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
CC @linkerzhang |
72f71e0 to
579be41
Compare
dzhulgakov
left a comment
There was a problem hiding this comment.
Cool, when it lands I can also upstream some changes from https://github.com/dzhulgakov/fast-neural-style to pytorch/examples (onnx exporter)
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I'm on the hook for finishing this. |
dzhulgakov
left a comment
There was a problem hiding this comment.
For mapping the tensor inputs - I wish we could find a better solution.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
6f2776d to
60abfe9
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
60abfe9 to
6f870f5
Compare
|
After reading this post, I tried to install pytorch by source and the onnx does work on instanceNorm2D now. Thanks. However, I encountered some other problems. I trained some pytorch model using the pytorch version installed through http://pytorch.org/. I was able to save the trained model as .pth file and load it back in successfully by doing the following:
However, after I install the latest pytorch from source. The load_state_dict is reporting errors:
I did the following to check which layer was causing the problem
I found that for the instanceNorm2D layers, model2 contains xxx.running_mean and xxx.running_var, but not model1. Any idea what I should do? |
|
Another question:
If I do |
* Add ONNX symbolic for instancenorm * Fix some bugs
Now, we export the InstanceNorm as an InstanceNorm op, not Reshape + BatchNorm + Reshape