-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[RLlib] ONNX example script: Enhance to work with torch + LSTM #43592
[RLlib] ONNX example script: Enhance to work with torch + LSTM #43592
Conversation
Signed-off-by: sven1977 <[email protected]>
…_example_script_for_torch_plus_lstm
…_example_script_for_torch_plus_lstm Signed-off-by: sven1977 <[email protected]> # Conflicts: # rllib/examples/checkpoints/onnx_torch.py
Signed-off-by: sven1977 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
) | ||
.environment("CartPole-v1") | ||
.env_runners(num_env_runners=args.num_env_runners) | ||
.training(model={"use_lstm": True}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If enable_rl_module_and_learner
is True
, it needs the model_config
in rl_module(model_config_dict= ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but this examples does NOT work yet on the new stack. I'll add an assert that --enable-new-api-stack is off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# Evaluate tensor to fetch numpy array | ||
result_pytorch = result_pytorch.detach().numpy() | ||
|
||
# This line will export the model to ONNX. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is a bid misleading - I guess it was intended for the code block below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: sven1977 <[email protected]>
…_example_script_for_torch_plus_lstm
Signed-off-by: sven1977 <[email protected]>
ONNX example script: Enhance to work with torch + LSTM
Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.