Open jhlq opened 5 months ago
Trying
import keras
keras.layers.TFSMLayer("/home/admins/fysik/KSTAR_tokamak_simulator/weights/k2rz/best_model0", call_endpoint="serving_default")
Gives the error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/admins/.local/lib/python3.10/site-packages/keras/src/export/export_lib.py", line 735, in __init__
self._reloaded_obj = tf.saved_model.load(filepath)
File "/home/admins/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/load.py", line 912, in load
result = load_partial(export_dir, None, tags, options)["root"]
File "/home/admins/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/load.py", line 1016, in load_partial
loader_impl.parse_saved_model_with_debug_info(export_dir))
File "/home/admins/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/loader_impl.py", line 59, in parse_saved_model_with_debug_info
saved_model = parse_saved_model(export_dir)
File "/home/admins/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/loader_impl.py", line 119, in parse_saved_model
raise IOError(
OSError: SavedModel file does not exist at: /home/admins/fysik/KSTAR_tokamak_simulator/weights/k2rz/best_model0/{saved_model.pbtxt|saved_model.pb}
Also your line of code has self.models.append(models.load_model(model_path+f'/best_model{i}',custom_objects={'r2_k':r2_k}))
a r2_k, how is that included?
Used a virtual environment with the following requirements.txt:
Keras==2.8
matplotlib==3.5.1
numpy==1.23.5
PyQt5-Qt5==5.15.2
PyQt5-sip==12.9.0
QtPy==1.9.0
scipy==1.8
tensorflow==2.8.0
protobuf==3.20
And it runs, with some issues:
2024-06-29 21:26:33.562427: W tensorflow/core/util/tensor_slice_reader.cc:96] Could not open /home/admins/fysik/KSTAR_tokamak_simulator/weights/lstm//best_model0: DATA_LOSS: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
2024-06-29 21:26:35.007038: W tensorflow/core/util/tensor_slice_reader.cc:96] Could not open /home/admins/fysik/KSTAR_tokamak_simulator/weights/lstm//best_model1: DATA_LOSS: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
2024-06-29 21:26:36.432100: W tensorflow/core/util/tensor_slice_reader.cc:96] Could not open /home/admins/fysik/KSTAR_tokamak_simulator/weights/lstm//best_model2: DATA_LOSS: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
2024-06-29 21:26:38.127055: W tensorflow/core/util/tensor_slice_reader.cc:96] Could not open /home/admins/fysik/KSTAR_tokamak_simulator/weights/lstm//best_model3: DATA_LOSS: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
2024-06-29 21:26:39.519651: W tensorflow/core/util/tensor_slice_reader.cc:96] Could not open /home/admins/fysik/KSTAR_tokamak_simulator/weights/lstm//best_model4: DATA_LOSS: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
I installed the most recent versions of the dependencies and got the following error when running python3 kstar_simulator_v0.py:
Is there a fix or should I downgrade Keras?