Replies: 1 comment 1 reply
-
@gingjehli was this resolved? Need to double check what is going on, but this code snippet is in fact specifically for allowing input and output dim's to be batchable (dynamic). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've trained a LAN on a new model and I'm trying to embed the resulting onnx file into HSSM.
For doing so, I've followed this tutorial: https://lnccbrown.github.io/HSSM/tutorials/blackbox_contribution_onnx_example/#build-hssm-models-starting-from-onnx-files
I can embed the onnx file and simulate data from the new model.
However, I've troubles to use the snippet below in the tutorial to actually make the network load dynamic input dimensions.
Specifically, this code snippet from the tutorial below is not working:
"
import onnx
import onnxruntime as ort
onnx_model = onnx.load(network_path)
for input_tensor in onnx_model.graph.input:
dim_proto = input_tensor.type.tensor_type.shape.dim[0]
if not dim_proto.dim_param == "None":
dim_proto.dim_param = "None"
for output_tensor in onnx_model.graph.output:
dim_proto = output_tensor.type.tensor_type.shape.dim[0]
if not dim_proto.dim_param == "None":
dim_proto.dim_param = "None"
input_name = onnx_model.graph.input[0].name
onnx.save(onnx_model, "test_files/race_3_no_bias_lan_batch.onnx")
"
I've tried to attach the corresponding onnx file and jupyter notebook to this thread.
In the jupyter notebook, you can see that I can compile the model but when I sample from it, it throws an error saying that the onnx file has dimension 1 but because of the simulated data, it is expecting 500.
what changes do I have to make?
Beta Was this translation helpful? Give feedback.
All reactions