-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Training] onnxruntime-training example has python import error #14637
Comments
@CapJunkrat apologies. This was tested against python 3.9. We didn't test with python 3.8. I will fix it in a PR. Thanks for reporting this. |
Glad to hear. Thank you! |
There are actually one more issue associated with this example. |
Looks like reset_grad is replaced by lazy_reset_grad. We should update the example with updated API. Did you give lazy_reset_grad a try? |
yes, the code worked and the result seems correct too. May I ask what is the difference between these 2 APIs? |
sorry, i didn't answer the question in time. the training api does not reset the gradient when The Hope that helps. |
Having said that, there was another idea to expose a function that would greedily reset the gradient (should the user ever need it). This has not been implemented yet. |
Got it! Thank you very much for the explaination @baijumeswani . I believe my problem here is solved. |
Describe the issue
I'm trying the onnxruntime-training examples from https://github.com/microsoft/onnxruntime-training-examples/blob/master/on_device_training/training_api_demo/mnist_training_example.ipynb
and got error:
File "/home/users/user/.local/lib/python3.8/site-packages/onnxruntime/training/api/module.py", line 128, in Module
def export_model_for_inferencing(self, inference_model_uri: str, graph_output_names: list[str]) -> None:
TypeError: 'type' object is not subscriptable
It also happened when I tried to use the nightly build. I've tried the following CPU versions and got the same result.
onnxruntime_training-1.15.0.dev20230201001+cpu-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
onnxruntime_training-1.15.0.dev20230207001+cpu-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
I'm using CentOS 7 system, python38, with onnxruntime version 1.13.1
To reproduce
I'm using CentOS 7 system, python38, with onnxruntime version 1.13.1 and run examples from https://github.com/microsoft/onnxruntime-training-examples/blob/master/on_device_training/training_api_demo/mnist_training_example.ipynb
Urgency
No response
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.13.1
PyTorch Version
1.11.0
Execution Provider
Default CPU, CUDA
Execution Provider Library Version
Cuda 11.6 and CPU versions
The text was updated successfully, but these errors were encountered: