kochsebastian / ChessVisionBot

Chessbot using computer vision to play on any chess website
GNU General Public License v3.0
43 stars 22 forks source link

Tensorflow SavedModel loading error #5

Closed yousufcodes786 closed 4 years ago

yousufcodes786 commented 4 years ago

kTraceback (most recent call last): File "main.py", line 272, in ml_model.init_binary() File "/home/kali/ChessVisionBot/code/ml_model.py", line 10, in init_binary binary_model = load_model(model_path) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/keras/saving/save.py", line 189, in load_model loader_impl.parse_saved_model(filepath) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/saved_model/loader_impl.py", line 110, in parse_saved_model raise IOError("SavedModel file does not exist at: %s/{%s|%s}" % OSError: SavedModel file does not exist at: /home/kali/ChessVisionBot/model_binary/binarymodel.h5/{saved_model.pbtxt|saved_model.pb}

while try to use in my kali vm it gives me this error , please help me to resolve this

kochsebastian commented 4 years ago

What TensorFlow version do you use?

yousufcodes786 commented 4 years ago

import tensorflow as tf

print(tf.version) 2.2.0

kochsebastian commented 4 years ago

That's the problem! This model vs build with tensorflow 1.15, which makes it incompatible with tensorflow 2. The easiest solution would be just to downgrade tensorflow in your venv to tf 1.15. If you don't want to do that (but I don't see no reason why not to do it) you could maybe convert the .h5 and .hd5f files to a model.pb file which seems to be accepted by tensorflow 2.0

kochsebastian commented 4 years ago

Closing because issue becoming stale