跳转到主要内容

使用onnxruntime训练Pytorch模型

项目描述

使用onnxruntime训练pytorch模型

构建(您需要更新version.txt中的版本号才能上传python whl文件)

rm dist/*
python setup.py bdist_wheel

发布

twine upload dist/*

安装

稳定版

(uninstall onnxruntime version that do not support gpu and training)
pip install torchort onnxruntime=1.9.0+cu111_training

夜间版

(make sure you are not in the ort repo folder - otherwise torchort is taken as already installed)
pip install --pre torchort ort-gpu-nightly-training

(eventually we are aiming at: pip install --pre torchort onnxruntime=1.9.0+cu111_training)

测试

python ./ort/tests/bert_for_sequence_classification.py

在PyTorch训练脚本中使用torchort

import onnxruntime
from torchort import ORTModule
model = ORTModule(model)
# normal PyTorch training script follows

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

此版本没有可用的源分布文件。请参阅生成分布存档的教程。

构建分布

torchort-0.0.8.dev20210317-py3-none-any.whl (2.7 kB 查看哈希值)

上传时间: Python 3

由以下支持