Expected behavior
onnx input which is called "neck.lateral_convs.2.conv2.weight_quantized" should be converted to ir name "neck_lateral_convs_2_conv2_weight_quantized"
Actual behavior
converted name is "eck_lateral_convs_2_conv2_weight_quantized"
Environment
- python 3.11.15
- tvm 0.25.0.post1 wheel
Steps to reproduce
just use a model which's layers' name is started with "n", and simply run from_onnx, then output the script
import onnx
from tvm.relax.frontend.onnx import from_onnx
onnx_model = onnx.load(r"yunet_qop_fxp_320.onnx")
ir = from_onnx(onnx_model, keep_params_in_input=True, sanitize_input_names=False)
printf(ir.script())
How to fix
replace line 5439 at python/tvm/relax/frontend/onnx/onnx_frontend.py (line number may change because of different versions)
# strip method will execute char by char at "onnx::" to delete charactor in init_tensor.name
var_name = init_tensor.name.strip("onnx::")
with
# using removeprefix method to remove a sequence "onnx::" in init_tensor.name
var_name = init_tensor.name.removeprefix("onnx::")
Expected behavior
onnx input which is called "neck.lateral_convs.2.conv2.weight_quantized" should be converted to ir name "neck_lateral_convs_2_conv2_weight_quantized"
Actual behavior
converted name is "eck_lateral_convs_2_conv2_weight_quantized"
Environment
Steps to reproduce
just use a model which's layers' name is started with "n", and simply run from_onnx, then output the script
How to fix
replace line 5439 at python/tvm/relax/frontend/onnx/onnx_frontend.py (line number may change because of different versions)
with