gmalivenko / pytorch2keras

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

Package crashes on import with protobuf==3.12.3 and tensorflow==2.2.0 on macOS #117

Open farzadab opened 4 years ago

farzadab commented 4 years ago

Describe the bug I cannot import the pytorch2keras package. I keep getting this error on import:

$ python -c "import pytorch2keras"
[libprotobuf ERROR google/protobuf/descriptor_database.cc:394] Invalid file descriptor data passed to EncodedDescriptorDatabase::Add().
[libprotobuf FATAL google/protobuf/descriptor.cc:1356] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
[1]    16043 abort      python

To Reproduce python -c "import pytorch2keras"

Expected behavior Not crashing.

Logs Already included

Environment (please complete the following information):

Additional context Quick search on the web shows similar problems with TensorFlow (and related libraries) all over the place. However, TF seems alone seems to work fine for me (no errors). Here you can see the links to related problems: https://github.com/tensorflow/tensorflow/issues/35573 https://github.com/onnx/tensorflow-onnx/issues/927 https://stackoverflow.com/questions/60028929/failing-to-launch-tensorboard-from-jupyter

I tried the solutions provided in all of the above (basically reinstalling everything multiple times with different version combinations) but none worked for me.