Open Neural Network Exchange (ONNX) is an open ecosystem that empowers AI developers to choose the right tools as their project evolves.
mmaction2 指南
Outline
6. 导出模型到ONNX
支持:
- I3D
- TSN
- TIN
- TSM
- R(2+1)D
- SLOWFAST
- SLOWONLY
- BMN
- BSN(tem, pem)
pip install onnx onnxruntime
# 用于 MMAction2 训练的模型导出到onnx
python tools/pytorch2onnx.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--shape ${SHAPE}] \
[--verify] [--show] [--output-file ${OUTPUT_FILE}] [--is-localizer] [--opset-version ${VERSION}]
--shape
: 模型的输入维度;
TSN的话:$batch $clip $channel $height $width
(e.g. 1 1 3 224 224
);
I3D 的话 $batch $clip $channel $time $height $width
(e.g. 1 1 3 32 224 224
) ;
BSN的话