gmalivenko / pytorch2keras

PyTorch to Keras model convertor
https://pytorch2keras.readthedocs.io/en/latest/
MIT License
857 stars 143 forks source link

onnx.optimizer does not exist anymore #132

Closed londumas closed 3 years ago

londumas commented 3 years ago

https://github.com/gmalivenko/pytorch2keras/blob/59bdb46ca55e951f527c9b729ee8602dcfdb28b6/pytorch2keras/converter.py#L8

The code tries to import a library, onnx.optimizer, which no longer exists in latests onnx. The imports work for onnx <1.9.0, does not work for >= 1.9.0. A simple solution for now is to comment out the import

metazool commented 3 years ago

https://github.com/onnx/onnx/issues/582#issuecomment-824263936 - the recommendation here is to downgrade the onnx dependency to 1.8.0... I'm curious if anyone's planning work to address this...

jcwchen commented 3 years ago

FYI: Actually onnxoptimizer is still available and ongoing from another repo: https://github.com/onnx/optimizer. It was moved out from ONNX package since ONNX 1.9.0. IIUC, you can still use it with the latest ONNX. Thanks!