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

YOLOV8 Assertion `serialized_engine' failed. 使用自己的.pt 生成 .wts 是成功的,但转.engine 是报错。chat说是卷积层权重数量不匹配 #1527

Open
cimmen opened this issue May 19, 2024 · 5 comments

Comments

@cimmen
Copy link

cimmen commented May 19, 2024

各版本
cuda 12.1
tensorrt 8.6.1
pytorch 2.2.2
cudnn 8.9.7

生成.pt的框架(是yolov8的官方镜像)
pytorch 2.0
cuda 11.8

:~/YOLO/yolov8$ python gen_wts.py -w cricle-n.pt -o c8n.wts -t detect
Generating .wts for detect model
Loading cricle-n.pt

~/YOLO/yolov8/build$ ./yolov8_det -s c8n.wts c8.engine n
^[[ALoading weights: c8n.wts
[05/19/2024-19:49:18] [W] [TRT] The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag whenever possible.
[05/19/2024-19:49:18] [E] [TRT] 3: (Unnamed Layer* 239) [Convolution]:kernel weights has count 36864 but 46080 was expected
[05/19/2024-19:49:18] [E] [TRT] 4: (Unnamed Layer* 239) [Convolution]: count of 36864 weights in kernel, but kernel dimensions (3,3) with 64 input channels, 80 output channels and 1 groups were specified. Expected Weights count is 64 * 33 * 80 / 1 = 46080
[05/19/2024-19:49:18] [E] [TRT] 4: [convolutionNode.cpp::computeOutputExtents::58] Error Code 4: Internal Error ((Unnamed Layer
239) [Convolution]: number of kernel weights does not match tensor dimensions)
[05/19/2024-19:49:18] [E] [TRT] 3: (Unnamed Layer* 258) [Convolution]:kernel weights has count 73728 but 92160 was expected
[05/19/2024-19:49:18] [E] [TRT] 4: (Unnamed Layer* 258) [Convolution]: count of 73728 weights in kernel, but kernel dimensions (3,3) with 128 input channels, 80 output channels and 1 groups were specified. Expected Weights count is 128 * 33 * 80 / 1 = 92160
[05/19/2024-19:49:18] [E] [TRT] 4: [convolutionNode.cpp::computeOutputExtents::58] Error Code 4: Internal Error ((Unnamed Layer
258) [Convolution]: number of kernel weights does not match tensor dimensions)
[05/19/2024-19:49:18] [E] [TRT] 3: (Unnamed Layer* 277) [Convolution]:kernel weights has count 147456 but 184320 was expected
[05/19/2024-19:49:18] [E] [TRT] 4: (Unnamed Layer* 277) [Convolution]: count of 147456 weights in kernel, but kernel dimensions (3,3) with 256 input channels, 80 output channels and 1 groups were specified. Expected Weights count is 256 * 33 * 80 / 1 = 184320
[05/19/2024-19:49:18] [E] [TRT] 4: [convolutionNode.cpp::computeOutputExtents::58] Error Code 4: Internal Error ((Unnamed Layer
277) [Convolution]: number of kernel weights does not match tensor dimensions)
Building engine, please wait for a while...
[05/19/2024-19:49:18] [E] [TRT] 4: [graphShapeAnalyzer.cpp::needTypeAndDimensions::2212] Error Code 4: Internal Error ((Unnamed Layer* 239) [Convolution]: output shape can not be computed)
[05/19/2024-19:49:18] [E] [TRT] 4: [network.cpp::validate::3093] Error Code 4: Internal Error (Could not compute dimensions for (Unnamed Layer* 239) [Convolution]_output, because the network is not valid.)
Build engine successfully!
yolov8_det: /home/big/YOLO/yolov8/yolov8_det.cpp:30: void serialize_engine(std::string&, std::string&, int&, std::string&, float&, float&, int&): Assertion `serialized_engine' failed.
已放弃 (核心已转储)

@cimmen cimmen closed this as completed May 20, 2024
@Muthukumar4796
Copy link

How can I overcome this issue?

@cimmen cimmen reopened this May 28, 2024
@cimmen
Copy link
Author

cimmen commented May 28, 2024

How can I overcome this issue?

Haven't solved yet

@cimmen
Copy link
Author

cimmen commented May 28, 2024

2024-05-28 23-53-48 的屏幕截图
2024-05-28 23-56-47 的屏幕截图
我修改了配置文件config.h;但还是不行

@Muthukumar4796
Copy link

Can you mail me.regarding this issue
[email protected]

@wang-xinyu
Copy link
Owner

@lindsayshuo pls advice.

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