FeiYull / TensorRT-Alpha

🔥🔥🔥TensorRT for YOLOv8、YOLOv8-Pose、YOLOv8-Seg、YOLOv8-Cls、YOLOv7、YOLOv6、YOLOv5、YOLONAS......🚀🚀🚀CUDA IS ALL YOU NEED.🍎🍎🍎
GNU General Public License v2.0
1.25k stars 195 forks source link

read the input data errors! #88

Closed sunyuxiu closed 4 months ago

sunyuxiu commented 4 months ago

“read the input data errors!” in ubuntu if the input is video or sometime in picture. As show! tensorrt-alpha/yolov5/build$ ./app_yolov5 --version=v570 --model=../../data/yolov5/best1.trt --size=640 --batch_size=8 --video=1.mp4 --savePath=../ [02/28/2024-11:35:36] [I] model_path = ../../data/yolov5/best1.trt [02/28/2024-11:35:36] [I] size = 640 [02/28/2024-11:35:36] [I] batch_size = 8 [02/28/2024-11:35:36] [I] video_path = 1.mp4 [02/28/2024-11:35:36] [I] save_path = ../ [02/28/2024-11:35:36] [I] yolov5 version = v570 [02/28/2024-11:35:36] [E] read the input data errors!

FeiYull commented 4 months ago

@sunyuxiu 输入的视频路径不对,使用绝对路径试一试

sunyuxiu commented 4 months ago

@sunyuxiu 输入的视频路径不对,使用绝对路径试一试

/data/soft/tensorrt-alpha/yolov5/build$ ./app_yolov5 --version=v570 --model=../../data/yolov5/best1.trt --size=640 --batch_size=8 --video=/data/soft/tensorrt-alpha/yolov5/build/1.mp4 --savePath=../ [02/28/2024-15:07:39] [I] model_path = ../../data/yolov5/best1.trt [02/28/2024-15:07:39] [I] size = 640 [02/28/2024-15:07:39] [I] batch_size = 8 [02/28/2024-15:07:39] [I] video_path = /data/soft/tensorrt-alpha/yolov5/build/1.mp4 [02/28/2024-15:07:39] [I] save_path = ../ [02/28/2024-15:07:39] [I] yolov5 version = v570 [02/28/2024-15:07:39] [E] read the input data errors! 绝对路径试过了,还是不行

sunyuxiu commented 4 months ago

@sunyuxiu 输入的视频路径不对,使用绝对路径试一试

/data/soft/tensorrt-alpha/yolov5/build$ ./app_yolov5 --version=v570 --model=../../data/yolov5/best1.trt --size=640 --batch_size=8 --video=/data/soft/tensorrt-alpha/yolov5/build/1.mp4 --savePath=../ [02/28/2024-15:07:39] [I] model_path = ../../data/yolov5/best1.trt [02/28/2024-15:07:39] [I] size = 640 [02/28/2024-15:07:39] [I] batch_size = 8 [02/28/2024-15:07:39] [I] video_path = /data/soft/tensorrt-alpha/yolov5/build/1.mp4 [02/28/2024-15:07:39] [I] save_path = ../ [02/28/2024-15:07:39] [I] yolov5 version = v570 [02/28/2024-15:07:39] [E] read the input data errors! 绝对路径试过了,还是不行

FeiYull commented 4 months ago

原因是没有读到视频文件,建议写个小程序测试下你当前路径是?

FeiYull @.***

------------------ Original ------------------ From: sunyuxiu @.> Date: Wed,Feb 28,2024 3:09 PM To: FeiYull/TensorRT-Alpha @.> Cc: FeiYull @.>, Comment @.> Subject: Re: [FeiYull/TensorRT-Alpha] read the input data errors! (Issue #88)

@sunyuxiu 输入的视频路径不对,使用绝对路径试一试

/data/soft/tensorrt-alpha/yolov5/build$ ./app_yolov5 --version=v570 --model=../../data/yolov5/best1.trt --size=640 --batch_size=8 --video=/data/soft/tensorrt-alpha/yolov5/build/1.mp4 --savePath=../ [02/28/2024-15:07:39] [I] model_path = ../../data/yolov5/best1.trt [02/28/2024-15:07:39] [I] size = 640 [02/28/2024-15:07:39] [I] batch_size = 8 [02/28/2024-15:07:39] [I] video_path = /data/soft/tensorrt-alpha/yolov5/build/1.mp4 [02/28/2024-15:07:39] [I] save_path = ../ [02/28/2024-15:07:39] [I] yolov5 version = v570 [02/28/2024-15:07:39] [E] read the input data errors! 绝对路径试过了,还是不行

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

sunyuxiu commented 4 months ago

我这是在ubuntu下,用pwd来查询和复制当前路径的

sunyuxiu commented 4 months ago

用图片测试也是,序号为1.jpg, 2.jpg, 3.jpg的时候,只有1.jpg和2.jpg可以测试出来,测试3.jpg就是显示read the input data errors!

FeiYull commented 4 months ago

所以,写个小程序读一下数据,可能是数据有问题

FeiYull @.***

------------------ Original ------------------ From: sunyuxiu @.> Date: Wed,Feb 28,2024 3:29 PM To: FeiYull/TensorRT-Alpha @.> Cc: FeiYull @.>, Comment @.> Subject: Re: [FeiYull/TensorRT-Alpha] read the input data errors! (Issue #88)

用图片测试也是,序号为1.jpg, 2.jpg, 3.jpg的时候,只有1.jpg和2.jpg可以测试出来,测试3.jpg就是显示read the input data errors!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

sunyuxiu commented 4 months ago

我写了一个opencv程序,读取OK的,数据没问题

FeiYull commented 4 months ago

可以把数据发网盘,我试下

FeiYull @.***

------------------ Original ------------------ From: sunyuxiu @.> Date: Wed,Feb 28,2024 3:35 PM To: FeiYull/TensorRT-Alpha @.> Cc: FeiYull @.>, Comment @.> Subject: Re: [FeiYull/TensorRT-Alpha] read the input data errors! (Issue #88)

我写了一个opencv程序,读取OK的,数据没问题

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

FeiYull commented 4 months ago

@sunyuxiu 你把图片发过来就行了, -_-!!!!

sunyuxiu commented 4 months ago

@FeiYull 稍等

sunyuxiu commented 4 months ago

链接:https://pan.baidu.com/s/1DhUY-Vkk1e4gJXR4CCcHqw 提取码:vnik

sunyuxiu commented 4 months ago

/data/soft/tensorrt-alpha/yolov5/build$ ./app_yolov5 --version=v570 --model=../../data/yolov5/best1.trt --size=640 --batch_size=8 --img=9.jpg --savePath=../ [02/28/2024-16:11:13] [I] model_path = ../../data/yolov5/best1.trt [02/28/2024-16:11:13] [I] size = 640 [02/28/2024-16:11:13] [I] batch_size = 8 [02/28/2024-16:11:13] [I] image_path = 9.jpg [02/28/2024-16:11:13] [I] savepath = ../ [02/28/2024-16:11:13] [I] yolov5 version = v570 [ WARN:0@0.005] global loadsave.cpp:241 findDecoder imread('%01d.jpg'): can't open/read file: check file path/integrity [02/28/2024-16:11:13] [I] [TRT] Loaded engine size: 31 MiB [02/28/2024-16:11:13] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +29, now: CPU 0, GPU 29 (MiB) [02/28/2024-16:11:13] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +270, now: CPU 0, GPU 299 (MiB) [02/28/2024-16:11:13] [E] [TRT] 3: [runtime.cpp::~Runtime::346] Error Code 3: API Usage Error (Parameter check failed at: runtime/rt/runtime.cpp::~Runtime::346, condition: mEngineCounter.use_count() == 1. Destroying a runtime before destroying deserialized engines created by the runtime leads to undefined behavior. ) [02/28/2024-16:11:13] [I] the engine's info: [02/28/2024-16:11:13] [I] idx = 0, images: -1, 3, 640, 640, [02/28/2024-16:11:13] [I] idx = 1, output0: -1, 25200, 6, [02/28/2024-16:11:13] [I] the context's info: [02/28/2024-16:11:13] [I] idx = 0, images: 1, 3, 640, 640, [02/28/2024-16:11:13] [I] idx = 1, output0: 1, 25200, 6, [02/28/2024-16:11:13] [I] 1 [02/28/2024-16:11:13] [E] [TRT] 1: [caskUtils.cpp::createCaskHardwareInfo::852] Error Code 1: Cuda Runtime (an illegal memory access was encountered) Segmentation fault (core dumped) 测试最后一张图片的时候就报这个错

sunyuxiu commented 4 months ago

/data/soft/tensorrt-alpha/yolov5/build$ ./app_yolov5 --version=v570 --model=../../data/yolov5/best1.trt --size=640 --batch_size=8 --img=9.jpg --savePath=../ [02/28/2024-16:11:13] [I] model_path = ../../data/yolov5/best1.trt [02/28/2024-16:11:13] [I] size = 640 [02/28/2024-16:11:13] [I] batch_size = 8 [02/28/2024-16:11:13] [I] image_path = 9.jpg [02/28/2024-16:11:13] [I] savepath = ../ [02/28/2024-16:11:13] [I] yolov5 version = v570 [ WARN:0@0.005] global loadsave.cpp:241 findDecoder imread('%01d.jpg'): can't open/read file: check file path/integrity [02/28/2024-16:11:13] [I] [TRT] Loaded engine size: 31 MiB [02/28/2024-16:11:13] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +29, now: CPU 0, GPU 29 (MiB) [02/28/2024-16:11:13] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +270, now: CPU 0, GPU 299 (MiB) [02/28/2024-16:11:13] [E] [TRT] 3: [runtime.cpp::~Runtime::346] Error Code 3: API Usage Error (Parameter check failed at: runtime/rt/runtime.cpp::~Runtime::346, condition: mEngineCounter.use_count() == 1. Destroying a runtime before destroying deserialized engines created by the runtime leads to undefined behavior. ) [02/28/2024-16:11:13] [I] the engine's info: [02/28/2024-16:11:13] [I] idx = 0, images: -1, 3, 640, 640, [02/28/2024-16:11:13] [I] idx = 1, output0: -1, 25200, 6, [02/28/2024-16:11:13] [I] the context's info: [02/28/2024-16:11:13] [I] idx = 0, images: 1, 3, 640, 640, [02/28/2024-16:11:13] [I] idx = 1, output0: 1, 25200, 6, [02/28/2024-16:11:13] [I] 1 [02/28/2024-16:11:13] [E] [TRT] 1: [caskUtils.cpp::createCaskHardwareInfo::852] Error Code 1: Cuda Runtime (an illegal memory access was encountered) Segmentation fault (core dumped) 测试最后一张图片的时候就报这个错

测试1-8.jpg的时候就没问题,测试最后一张9.jpg的时候就报错,然后添加一张10.jpg的话,9.jpg就没问题,10.jpg就会报上面的错,1-9.jpg都是在当前路径下,相对路径

FeiYull commented 4 months ago

@sunyuxiu 你给的图片,都可以正常推理(v5n小模型误检不用管),你用的tensorrt8.4? 3

sunyuxiu commented 4 months ago

@FeiYull tensorrt8.6

sunyuxiu commented 4 months ago

@FeiYull 你测试一下最后一张9.jpg

FeiYull commented 4 months ago

@sunyuxiu 测视频(yolov5n)效果也正常

1709108375690
FeiYull commented 4 months ago

@sunyuxiu 最后也正常 image

FeiYull commented 4 months ago

@sunyuxiu Q 732369616

sunyuxiu commented 4 months ago

@FeiYull 加过了,麻烦通过下

sunyuxiu commented 4 months ago

多谢@FeiYull 的解答,大概找到问题了,测试图片没问题,测试视频的时候一直找不到data,分析可能的原因是因为没有安装ffmpeg,现在安装下,等安装完再测试下再来反馈,再次感谢

sunyuxiu commented 4 months ago

踩坑纪录:可以读取到图片,但是读取不到视频的原因可能是没有安装ffmpeg,后来安装了ffmpeg后就可以读取、处理视频了(这里系统的opencv需要4.9版本的,我因为安装了3.x版本的,后来make的时候提示需要将opencv改为4.9版本,于是又改为了4.9版本,现在已经正常读取、识别了)