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

yolov5s v1.0 序列化报错 #3

Open
hoxcape opened this issue Jul 31, 2020 · 3 comments
Open

yolov5s v1.0 序列化报错 #3

hoxcape opened this issue Jul 31, 2020 · 3 comments

Comments

@hoxcape
Copy link

hoxcape commented Jul 31, 2020

我使用yolov5 v1.0训练了yolov5s模型,然后进行序列化,得到以下信息:

Loading weights: ../yolov5s.wts
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: kernel weights has count 2304 but 32640 was expected
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: count of 2304 weights in kernel, but kernel dimensions (1,1) with 128 input channels, 255 output channels and 1 groups were specified. Expected Weights count is 128 * 1*1 * 255 / 1 = 32640
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: kernel weights has count 2304 but 32640 was expected
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: count of 2304 weights in kernel, but kernel dimensions (1,1) with 128 input channels, 255 output channels and 1 groups were specified. Expected Weights count is 128 * 1*1 * 255 / 1 = 32640
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: kernel weights has count 2304 but 32640 was expected
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: count of 2304 weights in kernel, but kernel dimensions (1,1) with 128 input channels, 255 output channels and 1 groups were specified. Expected Weights count is 128 * 1*1 * 255 / 1 = 32640
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: kernel weights has count 2304 but 32640 was expected
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: count of 2304 weights in kernel, but kernel dimensions (1,1) with 128 input channels, 255 output channels and 1 groups were specified. Expected Weights count is 128 * 1*1 * 255 / 1 = 32640
Building engine, please wait for a while...
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: kernel weights has count 2304 but 32640 was expected
[07/31/2020-11:37:13] [E] [TRT] (Unnamed Layer* 173) [Convolution]: count of 2304 weights in kernel, but kernel dimensions (1,1) with 128 input channels, 255 output channels and 1 groups were specified. Expected Weights count is 128 * 1*1 * 255 / 1 = 32640
[07/31/2020-11:37:13] [E] [TRT] Could not compute dimensions for (Unnamed Layer* 173) [Convolution]_output, because the network is not valid.
[07/31/2020-11:37:13] [E] [TRT] Network validation failed.
Build engine successfully!
yolov5s: yolov5_tensorrt/yolov5s/yolov5s.cpp:170: void APIToModel(unsigned int, nvinfer1::IHostMemory**): Assertion `engine != nullptr' failed.
已放弃 (核心已转储)

请帮我看一下大概是什么问题,谢谢了。

@hoxcape
Copy link
Author

hoxcape commented Jul 31, 2020

我比对过yolov5s.yaml了,模型配置和库里的一致

@AIpakchoi
Copy link
Owner

@hoxcape 你这个engine没有成功生成,貌似是三个YOLO head层的参数不对,255 = (80+5)*3,即80个类,5个预测值,每个尺度用3个anchor。如果你用自己的数据训练的,请在yololayer.h文件中把自己数据的类别、anchor等参数修改以下。重新cmake,make编译一下。

@hoxcape
Copy link
Author

hoxcape commented Jul 31, 2020

谢谢,我试试

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

2 participants