3. Run the convert.py, and the converted model is located in the models directory.
$ python convert.py
# /Users/xxx/miniconda3/envs/convert_latex_ocr/lib/python3.10/site-packages/torch/onnx/symbolic_helper.py:1513: UserWarning: ONNX export mode is set to TrainingMode.EVAL, but operator 'batch_norm' is set to train=True. Exporting with train=True.# warnings.warn(# Exported model has been tested with ONNXRuntime, and the result looks good!# ONNX Model has been saved /Users/xxx/projects/_self/ConvertLaTeXOCRToONNX/models/image_resizer.onnx# Exported model has been tested with ONNXRuntime, and the result looks good!# ONNX Model has been saved /Users/xxx/projects/_self/ConvertLaTeXOCRToONNX/models/encoder.onnx# Exported model has been tested with ONNXRuntime, and the result looks good!# ONNX Model has been saved /Users/xxx/projects/_self/ConvertLaTeXOCRToONNX/models/decoder.onnx# \exp\left[\int d^{4}x g\phi\bar{\psi}\psi\right]=\sum_{n=0}^{\infty}\frac{g^{n}}{n!}\left(\int d^{4}x\phi\bar{\psi}\psi\right)^{n}.
请问encoder只能固定尺寸推理吗,我使用动态尺寸推理会出现如下错误:
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Add node. Name:'/Add_2' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/math/element_wise_ops.h:560 void onnxruntime::BroadcastIterator::Append(ptrdiff_t, ptrdiff_t) axis == 1 || axis == largest was false. Attempting to broadcast an axis by a dimension other than 1. 49 by 57