1

I'm using auto-py-to-exe [settings are: One File, Window Based (hide the console)] to convert myPyQt5Code.py to an executable Windows file myApp.exe. It works fine and I can run myApp.exe, but if I import load_model (to read my model from the same directory) and then run the auto-py-to-exe again on the same myPyQt5Code.py file (with the new import line), it gives the following error (when I run myApp.exe):

enter image description here

I read many related questions/answers, some of them say that I should downgrade my tensorflow from 2.x to 1.14 because the PyInstaller cannot deal with higher versions of tensorflow, I downgraded but I still have the same error.

My current version of tensorflow is downgraded to 1.14 (I can upgrade it again to 2.0 if needed)

Update:

In sum, I need a set of compatible versions of PyQt5, Tensorflow, Keras and PyInstaller work correctly all together to deploy my project as an executable Windows application.

I would appreciate it if someone suggests any valid set of versions.

catfour
  • 119
  • 3
  • 10

1 Answers1

1

Try it once.

python -m pip install tensorflow==1.5
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Chandan
  • 571
  • 4
  • 21
  • Thank you for your answer. The import line works fine now after installing tensorflow==1.5, but `load_model` gives the error `cannot import name 'tf_utils'`, and I tried to solve it by installing keras==2.2.0 (according to answer [here](https://stackoverflow.com/a/57985905/6784796)), again another problem appeared `ValueError: Unknown layer:name` – catfour Feb 24 '20 at 11:14
  • I also tried to solve it by installing keras==2.2.4 (according to the comment [here](https://stackoverflow.com/questions/53180589/keras-valueerror-unknown-layername-when-trying-to-load-model-to-another-platf#comment93530106_53235982)), but now I have the error `TypeError: Unexpected keyword argument passed to optimizer: learning_rate` and I have to [upgrade keras again](https://stackoverflow.com/questions/58028976/typeerror-unexpected-keyword-argument-passed-to-optimizer-learning-rate) to solve it!! – catfour Feb 24 '20 at 11:14
  • Can you please provide a solution for PyInstaller 3.6 with TensorFlow 2.1? – fisakhan Jun 05 '20 at 12:52