-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError when trying to use a trained PPO with LSTMs (defined in config) using Pytorch framework on same env as trained #13026
Comments
I have the same issue when using custom RNN model. Seems like some keys in edit: Mine happened during training initialization but have the same error as above Ray 1.0.1.post1 |
@51616 What was the last ray version your code worked with?? For the moment that can be a solution, until this issue is solved. |
@alexvaca0 I just upgraded directly to master from 0.8.5. I have no idea which one works apart from 0.8.5. But The APIs are changed a lot since then so you may have to fix a lot of your code just for it to work with the old ones. It could be a band-aid solution for now. |
@deanwampler @rshin @ericl Please someone can take a look at this? |
@alexvaca0 Actually, I manage to run a code similar to your example without the error. The return values from I did not load the checkpoint though. It might cause a different behaviour. You should try it with your checkpoint. |
Could you post a code example of how you'd add those parameters to the function call in agent.compute_action()? @51616 |
I'm trying this:
But gives the following error:
|
|
Thanks you so much!! :) @51616 |
I found a solution to my custom model too. Here what's needed for the model to use
Taken from the default LSTM model in |
Yeah, I took a look at it too, but the thing is that internally, there should be some place where if PREV_ACTIONS or PREV_REWARDS is None, it's filled with 0s (the same with state). Actually, there might be somewhere in the trainer or somewhere else, where this is done for training, as training in my case worked properly. |
Downgrading this to P3.
|
facing same issue but key error is coming for '1' , compute_single_action does not work ( version 2.9.2 ray) Running this code
getting this error
|
What is the problem?
I've already trained an agent with PPO and a model with LSTMs with an environment, successfully. But when I try to test the trained agent loading it from the last checkpoint, it cannot take the first action, with a KeyError:
Ray version and other system information (Python version, TensorFlow version, OS):
System information:
Reproduction (REQUIRED)
For reproducing it a checkpoint should be created first, but I'll pass the configuration:
If the code snippet cannot be run by itself, the issue will be closed with "needs-repro-script".
@deanwampler @ericl @rshin @yaroslavvb
The text was updated successfully, but these errors were encountered: