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

wts转化engine模型失败,Load engine file failed: D:/YOLOv8/yolov8_tensorrt-main/weights/yolov8n.engine #1576

Open
ranranmen opened this issue Sep 15, 2024 · 3 comments

Comments

@ranranmen
Copy link

Env

  • gtx1050
  • Win10
  • cuda12.0
  • TensorRT-8.6.1.6

About this repo

yolov8
##problem
您好,我在得到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
我现在思考是不是因为,我安装了cuda之后再装的visual studio导致的(针对这个编译前我已经把cuda相关文件复制到vs里面了),转化模型修改参数,目前还没有做过修改

@ranranmen
Copy link
Author

后续是这样的
yolov8.exe -s D:\YOLOv8\yolov8_tensorrt-main\weights\yolov8n.wts D:\YOLOv8\yolov8_tensorrt-main\weights\yolov8n.engine n
CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
Loading weights: ..weights/yolov8n.wts
The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag whenever possible.
3: (Unnamed Layer* 0) [Convolution]:kernel weights has count 0 but 864 was expected
4: (Unnamed Layer* 0) [Convolution]: count of 0 weights in kernel, but kernel dimensions (3,3) with 3 input channels, 32 output channels and 1 groups were specified. Expected Weights count is 3 * 33 * 32 / 1 = 864
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)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setScale::23] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setScale::23, condition: scale.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setShift::24] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setShift::24, condition: shift.count > 0
)
3: [scaleLayer.h::nvinfer1::ScaleLayer::setPower::25] Error Code 3: API Usage Error (Parameter check failed at: scaleLayer.h::nvinfer1::ScaleLayer::setPower::25, condition: power.count > 0
)
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
)

@lindsayshuo
Copy link
Contributor

kernel weights has count 0 but 864 was expected

看这个报错

“kernel weights has count 0 but 864 was expected”

检查下wts

@felipemasuda
Copy link
Contributor

Any solution?

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