DQN save/restore not able to be restored #1150
-
I am currently using the open_spiel DQN library (with colab, and Google Drive). I've trained a model as follows:
I then save the model using the However, when I try to restore the saved model using the same parameters and the I get this error: After printing out all the variables in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi, This is almost always because the TF environment (graph) looks different when restoring than when it was saved. For TF to load properly, the graph has to be exactly the same. So e.g. if you trained with multiple copies of DQN, you have to recreate that environment with multiple DQN agents upon loading, even if you only intend to use one of them, because TF will recreate the graph the same way as during training. Could this be it? If not, I will try locally tomorrow to see if there is an existing issue with saving/loading. |
Beta Was this translation helpful? Give feedback.
Hi,
This is almost always because the TF environment (graph) looks different when restoring than when it was saved.
For TF to load properly, the graph has to be exactly the same. So e.g. if you trained with multiple copies of DQN, you have to recreate that environment with multiple DQN agents upon loading, even if you only intend to use one of them, because TF will recreate the graph the same way as during training.
Could this be it? If not, I will try locally tomorrow to see if there is an existing issue with saving/loading.