-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
动态batch推理 #9
Comments
我也遇到了相同的问题,可视化发现concat和reshape算子那边有点问题,onnxruntime测试也是,最后定位在common.py的channel_shuffle这边,需要把batch_size设置为-1,其他对应修改就可以了。 |
哥们,很感谢你提供的解决方案,这个common.py是修改完后,需要重新训练一下模型吗?还是在导出为onnx的时候修改? |
|
应该不需要重新训练,导出的时候修改就可以。 |
def channel_shuffle(x, groups):
哥们,你好,我在这个地方做了一下修改,导出的时候报错了,你那边具体是怎么修改的 方便说一下吗?
RuntimeError: only one dimension can be inferred |
x = x.view(batchsize, -1, height, width) |
你好,博主,很感谢你的项目代码,目前在用这个代码的时候遇到一点问题,我在导出onnx的时候,设置了动态batch,基于yolov5和yolov7的版本,都做了尝试,发现报了同样的错误,在多张图片同时进行推理的时候
Reshape node. Name:'/model.1/Reshape' Status Message: D:\a_work\1\s\onnxruntime\core\providers\cpu\tensor\reshape_helper.h:41 onnxruntime::ReshapeHelper::ReshapeHelper gsl::narrow_cast<int64_t>(input_shape.Size()) == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{2,96,80,80}, requested shape:{1,2,48,80,80}
看着像是在某个节点reshape的时候报错了,yolov5和v7都是在同样的节点,想问下博主这种情况怎么解决?还是我操作的有问题?
The text was updated successfully, but these errors were encountered: