mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-19 19:00:47 +00:00
### Description Staged: https://faxu.github.io/onnxruntime/docs/ Changes: - ~~New dedicated section on sidebar for [Mobile](https://faxu.github.io/onnxruntime/docs/mobile/) and [Web](https://faxu.github.io/onnxruntime/docs/web/)~~ New dedicated pages for [Mobile](https://faxu.github.io/onnxruntime/docs/get-started/with-mobile.html) and [Web](https://faxu.github.io/onnxruntime/docs/get-started/with-web.html) under Getting Started section - [Transformers optimizer](https://faxu.github.io/onnxruntime/docs/performance/transformers-optimization.html) documentation - Move contrib op section from "Custom Operators" page to ["Contrib operators" page](https://faxu.github.io/onnxruntime/docs/reference/operators/ContribOperators.html) - Update [releases page](https://faxu.github.io/onnxruntime/docs/reference/releases-servicing.html)
33 lines
No EOL
865 B
Markdown
33 lines
No EOL
865 B
Markdown
---
|
|
title: ORT Training with PyTorch
|
|
parent: Get Started
|
|
nav_order: 12
|
|
---
|
|
|
|
# Get started with ORT for Training API (PyTorch)
|
|
{: .no_toc }
|
|
The ORT Training API is a PyTorch frontend that implements the torch.nn.Module interface.
|
|
|
|
|
|
## ORT Training Example
|
|
In this example we will go over how to use ORT for Training a model with PyTorch.
|
|
|
|
```
|
|
pip install torch-ort
|
|
python -m torch_ort.configure
|
|
```
|
|
|
|
**Note**: This installs the default version of the `torch-ort` and `onnxruntime-training` packages that are mapped to specific versions of the CUDA libraries. Refer to the install options in [ONNXRUNTIME.ai](https://onnxruntime.ai).
|
|
|
|
- Add ORTModule in the `train.py`
|
|
```python
|
|
from torch_ort import ORTModule
|
|
.
|
|
.
|
|
.
|
|
model = ORTModule(model)
|
|
```
|
|
|
|
|
|
## Samples
|
|
[ONNX Runtime Training Examples](https://github.com/microsoft/onnxruntime-training-examples) |