PINNs-based-MPC icon indicating copy to clipboard operation
PINNs-based-MPC copied to clipboard

Problems running the code

Open moowees opened this issue 1 year ago • 1 comments

Hi, i have problems running the code. Seems to be soething with tensorflow. Have you had this issue?

2023-11-03 10:42:15.612564: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
INFO:root:TensorFlow version: 2.14.0
INFO:root:Eager execution: True
INFO:root:MPC parameters:
INFO:root:	H:	5
INFO:root:	tau:	0.2
Traceback (most recent call last):
  File "E:\PINNs-based-MPC-1.0.0\src\main.py", line 56, in <module>
    pinn.load_weights(weights_path)
  File "E:\PINNs-based-MPC-1.0.0\src\model\nn.py", line 265, in load_weights
    self.model.load_weights(tf.train.latest_checkpoint(path))
  File "E:\PINNs-based-MPC-1.0.0\venv\lib\site-packages\tensorflow\python\keras\engine\training.py", line 2317, in load_weights
    status = self._checkpoint.read(filepath, options)
  File "E:\PINNs-based-MPC-1.0.0\venv\lib\site-packages\tensorflow\python\checkpoint\checkpoint.py", line 2540, in read
    result = self._saver.restore(save_path=save_path, options=options)
  File "E:\PINNs-based-MPC-1.0.0\venv\lib\site-packages\tensorflow\python\checkpoint\checkpoint.py", line 1461, in restore
    restore_lib.CheckpointPosition(
  File "E:\PINNs-based-MPC-1.0.0\venv\lib\site-packages\tensorflow\python\checkpoint\restore.py", line 62, in restore
    restore_ops = self._restore_descendants(reader)
  File "E:\PINNs-based-MPC-1.0.0\venv\lib\site-packages\tensorflow\python\checkpoint\restore.py", line 459, in _restore_descendants
    _queue_children_for_restoration(current_position, visit_queue)
  File "E:\PINNs-based-MPC-1.0.0\venv\lib\site-packages\tensorflow\python\checkpoint\restore.py", line 606, in _queue_children_for_restoration
    local_object = trackable._lookup_dependency(child.local_name,
TypeError: _lookup_dependency() takes 2 positional arguments but 3 were given
WARNING:tensorflow:Detecting that an object or model or tf.train.Checkpoint is being deleted with unrestored values. See the following logs for the specific values in question. To silence these warnings, use `status.expect_partial()`. See https://www.tensorflow.org/api_docs/python/tf/train/Checkpoint#restorefor details about the status object returned by the restore function.
WARNING:tensorflow:Detecting that an object or model or tf.train.Checkpoint is being deleted with unrestored values. See the following logs for the specific values in question. To silence these warnings, use `status.expect_partial()`. See https://www.tensorflow.org/api_docs/python/tf/train/Checkpoint#restorefor details about the status object returned by the restore function.
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-0.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-0.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-0.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-0.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-1.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-1.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-1.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-1.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-2.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-2.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-2.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-2.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-3.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-3.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-3.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-3.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-4.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-4.kernel
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-4.bias
WARNING:tensorflow:Value in checkpoint could not be found in the restored object: (root).layer_with_weights-4.bias

Best Regards

moowees avatar Nov 03 '23 09:11 moowees

Hi, I updated the requirements.txt to fixed versions. Can you try to run it again with those versions? And I think you should use python 3.9 if possible.

Jonas-Nicodemus avatar Nov 15 '23 14:11 Jonas-Nicodemus