Skip to content
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

widonws下yolov8模型生成wts转engine文件报错 #1533

Open
XuJWood opened this issue May 27, 2024 · 4 comments
Open

widonws下yolov8模型生成wts转engine文件报错 #1533

XuJWood opened this issue May 27, 2024 · 4 comments

Comments

@XuJWood
Copy link

XuJWood commented May 27, 2024

Env

  • GPU, e.g. 4070
  • OS, e.g. Win10, etc.
  • Cuda v11.8
  • TensorRT 8.6.1

About this repo

  • which branch/tag/commit are you using?
  • which model? yolov5, retinaface?

yolov8-seg

Your problem

  • what is your command? e.g. sudo ./yolov5 -s
  • what's your output?
  • what output do you expect?

我从官网下载的yolov8s-seg.pt,在tensorrt项目中利用get_wts.py生成yolov8s-seg.wts,然后在项目中生成engine文件时报错。
Loading weights: ../weights/yolov8s-seg.wts
[05/27/2024-11:09:22] [W] [TRT] The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag whenever possible.
[05/27/2024-11:09:22] [E] [TRT] 3: (Unnamed Layer* 0) [Convolution]:kernel weights has count 864 but 0 was expected
[05/27/2024-11:09:22] [E] [TRT] 4: (Unnamed Layer* 0) [Convolution]: count of 864 weights in kernel, but kernel dimensions (3,3) with 3 input channels, 0 output channels and 1 groups were specified. Expected Weights count is 3 * 33 * 0 / 1 = 0
[05/27/2024-11:09:22] [E] [TRT] 4: [convolutionNode.cpp::nvinfer1::builder::ConvolutionNode::computeOutputExtents::58] Error Code 4: Internal Error ((Unnamed Layer
0) [Convolution]: number of kernel weights does not match tensor dimensions)
[05/27/2024-11:09:22] [E] [TRT] 3: [network.cpp::nvinfer1::Network::addResize::1421] Error Code 3: API Usage Error (Parameter check failed at: network.cpp::nvinfer1::Network::addResize::1421, condition: input.getDimensions().nbDims > 0

请问是什么原因,应该如何解决呢

@wang-xinyu
Copy link
Owner

@lindsayshuo pls advice.

@XuJWood
Copy link
Author

XuJWood commented May 30, 2024

已经解决,是因为模型转化的时候 float gd = 0.33, gw = 0.50; int max_channels = 1024;没有修改,设置为0,所以通道不匹配,谢谢!

Copy link

stale bot commented Sep 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 6, 2024
@ranranmen
Copy link

您好,我在得到yolov8n.exe文件之后转化engine模型就遇到了下面这个问题
cmd之后
D:\YOLOv8\yolov8_tensorrt-main\build\Release>yolov8.exe -s D:\YOLOv8\weights\yolov8n.wts D:\YOLOv8\weights\yolov8n.engine s
Load engine file failed: D:/YOLOv8/yolov8_tensorrt-main/weights/yolov8n.engine
很纳闷,我的环境是
cuda12.0
gtx050
TensorRT-8.6.1.6
opencv4.8.0(编译过支持cuda加速的),我现在思考是不是因为,我安装了cuda之后再装的visual studio导致的(针对这个编译前我已经把cuda相关文件复制到vs里面了),但您上面说的转化模型修改参数,我没有做过更改,直接默认的

@stale stale bot removed the wontfix This will not be worked on label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants