You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
session1 = onnxruntime.InferenceSession('./tmp/model_inner.onnx')
input_name1 = session1.get_inputs()[0].name
input_name2 = session1.get_inputs()[1].name
print(input_name1, input_name2)
output_name = session1.get_outputs()[0].name
print(output_name)
for _ in range(10):
x = torch.randn((random.randint(1, 2), 256))
patch_list.append(x)
x = F.normalize(x, p=2, dim=-1)
edge_index = knn_graph(x, k=10, loop=False)
print(x.shape, edge_index.shape)
outputs = session1.run([e.name for e in session1.get_outputs()], {input_name1: x.numpy(), input_name2: edge_index.numpy()})
In the loop of runtime test(10 loop), if the shape[0] of random generated x more than 1, the onnx can run without problem. But when the shape[0] of x is 1(in this case, edge_index is [2, 0]), ONNXRuntimeError happend:
2024-11-27 10:59:23.162258055 [E:onnxruntime:, sequential_executor.cc:516 ExecuteKernel] Non-zero status code returned while running Expand node. Name:'/model/conv1/Expand' Status Message: invalid expand shape
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running Expand node. Name:'/model/conv1/Expand' Status Message: invalid expand shape
🐛 Describe the bug
my model:
onnx wrapper:
onnx convert code:
onnx runtime test code:
In the loop of runtime test(10 loop), if the shape[0] of random generated x more than 1, the onnx can run without problem.
But when the shape[0] of x is 1(in this case, edge_index is [2, 0]), ONNXRuntimeError happend:
Versions
the part packages version of my environment:
The text was updated successfully, but these errors were encountered: