Open maybeLee opened 2 years ago
I happen the same problem. Have you solved this?
Encountered the same problem while converting PiDiNet into ONNX.
I think the error message tells us everything. The error message tells us that it happened "while running FusedConv node" and the error is "bias should be 1D". In this graph, it may not be obvious that in the "Add" operator it is actually a bias computation, from “FusedConv” , we can know that onnxruntime is trying to fuse the graph, so it is easy to know that it is trying to fuse bias and conv together, which is a very common graph optimization operation. But in the traditional sense of fusing bias and conv, the bias here is actually a 1D data, which should come from Conv, for example, torch.Conv2D(bias=True) the bias generated here. But in this graph, the bias here is in fact a 4D data, which is actually not the true bias with conv. So the solution is simple, since it appears in the "FusedConv" process, as long as we don't fuse it, we won't report an error. By consulting onnxruntime's doc we can simply add a few lines of code that will disable the fusion and make it work successfully:
sess_options = ort.SessionOptions()
sess_options.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_BASIC
model = ort.InferenceSession(onnx_path, sess_options=sess_options, providers=providers)
I happen the same problem. Have you solved this?
add bias in Conv at the original model can solve this problem.
Same issue here, thanks for the workaround. It seems like a fix has been merged, so this can be closed, no?
Describe the bug The graph that result in this issue (can be accessed through this link):
When I run this graph on CPU mode, it works normally with no error, but when I run this graph on GPU mode, it throws a runtime error as follows:
To Reproduce
Please first download the onnx graph through: https://drive.google.com/file/d/1mHUJuhjUxGjjWmpwwXe8NS-jOXhEts4y/view?usp=sharing Then run the following code:
System information
Expected behavior ONNXRuntime should behave the same between GPU context and CPU context. And in this case, I think it should work normally in GPU mode.