- Using JIT compile support since PyTorch 1.0.0
- python == 3.7.0
- torch == 1.0.0
- numpy == 1.16.0
- Upgrade PyTorch
pip install --upgrade pip
pip install --upgrade torch
pip install --upgrade numpy
refer trace_benchmark_DNN/benchmark.py or trace_trained_RNN/trace.py
- training a model in PyTorch
- create a "tracer" which is an input tensor of the model
- trace model by passing through the tracer to the model with
torch.jit.trace(your_model, tracer)
overall process is executed by followings
git clone https://github.com/hyoungseok/jitTutorial.git
cd jitTutorial/trace_trained_RNN
python main.py
the traced file traced_model.pth will be created under the jitTutorial/trace_trained_RNN
- YongRae Jo (dreamgonfly@gmail.com)
- Alex Kim (hyoungseok.k@gmail.com)