gmalivenko / pytorch2keras

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

Expose onnx optimizer #88

Closed SleepProgger closed 5 years ago

SleepProgger commented 5 years ago

This PR exposes the onnx.optimzer and the do_constant_folding parameter of torch.onnx.export to be able to optimize the model after exporting.

The use_optimizer parameter of pytorch_to_keras can be one of:

There are only 3 optimizer i had problems with:

Both do_constant_folding and use_optimizer default to False.

gmalivenko commented 5 years ago

Yes, I think it's a good idea to optimize graph before calling the converter.