gmalivenko / pytorch2keras

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

How to import pytorch 2 keras? #144

Open vitoriarlima opened 2 years ago

vitoriarlima commented 2 years ago

Describe the bug

There are dependencies of this repo that are not clear and old

To Reproduce Snippet of my code

Trying to import pytorch to eras Screenshot 2022-05-08 at 16 50 07

Screenshot 2022-05-08 at 16 46 15

Expected behavior I am trying to import pytorch 2 keras but it required me to install onnx which I did but then it complains that some of the things you are importing do not exist

Environment (please complete the following information): I am trying import this to a Jupiter notebook on Google Colab

balisujohn commented 2 years ago

This failure I think is mentioned in this issue: https://github.com/gmalivenko/pytorch2keras/issues/132. Based on my own use of the package, it is fixed in the version of the repo in master, but not in the most current version on pypi. You will need to install via pip the most recent commit: https://stackoverflow.com/questions/13685920/install-specific-git-commit-with-pip. I don't know how to do this with colab. I think this package needs a new PyPi version, since the most recent PyPi version is from 2020.

You might also be able to use an old version of onnx, but I forget specifics.