Add torch version constraint to be equal or less than 2.8.0 to prevent breaking onnx changes in torch 2.9.0 #6251
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change(s)
The new
2.9.0
torch version released 2 day ago results in an issue findingonnxscript
.ml-agents
is configured to take any version >=2.1.1
so it will take this version. Full credits to @Nitesh-joestar for identifying the issue and the fix for this in #6250.Adding a constraint that maximum version is
2.8.0
prevents this error.I'm not exactly of the exact root cause but it seems there were some backwards incompatible changes to onnx: https://github.com/pytorch/pytorch/releases/tag/v2.9.0#backwards-incompatible-changes.
Stack trace on exiting training:
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
#6250
Types of change(s)
Checklist
Other comments
Tested with torch version 2.8.0, running training, then exiting training; and confirm file saved correctly: