Empty params from tvm.relay.frontend.from_onnx()

tvm.relay.frontend.from_onnx() returns empty params with TVM 0.13.0 / 0.16.0.

ir_module, params = tvm.relay.frontend.from_onnx(model_onnx, shape_dict, dtype_dict)

I tried ‘relax’ instead of ‘relay’, it returns params but the result causes error while tvm.relay.quantize.quantize().

ir_module = tvm.relax.frontend.onnx.from_onnx(model_onnx, keep_params_in_input=True) ir_module, params = tvm.relax.frontend.detach_params(ir_module)

Are there any solutions to get correct parameters by using ‘relay from_onnx()’.

Thanks.

There’s an argument to the relay from_onnx() function called freeze_params that is set to True by default. If this is True, then the params are embedded as constants into the mod instead of returning them as params that would become variables. If you need the params returned, you can pass False to this argument from_onnx(..., freeze_params=False)