onnxruntime/samples/python/pytorch_transformer
Thiago Crepaldi 563218dcda
Update torchtext usage for pytorch transformer sample (#6767)
* Update torchtext usage for pytorch transformer sample
* Temporarily disable tests to unblock repo (failures are being worked on already)
* Update loss numbers for ORTTrainer UTs
2021-02-23 14:06:35 -08:00
..
ort_train.py
ort_utils.py
pt_model.py
pt_train.py
README.md
utils.py

TransformerModel example

This example was adapted from Pytorch's Sequence-to-Sequence Modeling with nn.Transformer and TorchText tutorial

Requirements

  • PyTorch 1.6+
  • TorchText 0.6+
  • ONNX Runtime 1.5+

Running PyTorch version

python pt_train.py

Running ONNX Runtime version

python ort_train.py

Optional arguments

Argument Description Default
--batch-size input batch size for training 20
--test-batch-size input batch size for testing 20
--epochs number of epochs to train 2
--lr learning rate 0.001
--no-cuda disables CUDA training False
--seed random seed 1
--log-interval how many batches to wait before logging training status 200