-
Notifications
You must be signed in to change notification settings - Fork 142
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
在创建gt database时报错 #443
Comments
您好,从报错看应该还是im_path不正确或是某些图片文件缺失导致imread没有读取到图片出现None的情况,建议在代码中增加一些im_path打印或者os.path.exists检查下路径和图片读取的正确性 |
我的路径存在,且直接使用cv2.imread可以读取这些图片,print(cv2.imread("kittimini/training/image_2/000012.png").shape[:2])可以正常返回(375, 1242) |
可能跟环境有关,可以检查下opencv-python的版本以及依赖的libpng的版本,或者试下其他图像读取库如PIL Image.open()看下能否正常读取 |
在我将opencv-python版本切换成4.5.5.64后,再次运行create_det_gt_database.py脚本,报错变成了 |
这个应该和opencv的依赖有关,建议尝试下其他opencv的版本如4.6.0.66 |
在我按照readme中尝试使用kitti数据集时,使用python ./Paddle3D/tools/create_det_gt_database.py --dataset_name kitti --dataset_root ./kittimini --save_dir ./dataset/kitti命令创建gt database时报错
2024-01-11 16:29:09,128 - INFO - Begin to generate a database for the KITTI dataset.
libpng error: IDAT: bad parameters to zlib
Traceback (most recent call last):
File "/home/lucas/PycharmProjects/paddle3d/./Paddle3D/tools/create_det_gt_database.py", line 55, in
main(args)
File "/home/lucas/PycharmProjects/paddle3d/./Paddle3D/tools/create_det_gt_database.py", line 46, in main
generate_kitti_gt_database(args.dataset_root, save_dir=args.save_dir)
File "/home/lucas/.conda/envs/paddle/lib/python3.9/site-packages/paddle3d-1.0.0-py3.9.egg/paddle3d/datasets/generate_gt_database.py", line 52, in generate_kitti_gt_database
sample = dataset[data_idx]
File "/home/lucas/.conda/envs/paddle/lib/python3.9/site-packages/paddle3d-1.0.0-py3.9.egg/paddle3d/datasets/kitti/kitti_pointcloud_det.py", line 62, in getitem
sample = self.transforms(sample)
File "/home/lucas/.conda/envs/paddle/lib/python3.9/site-packages/paddle3d-1.0.0-py3.9.egg/paddle3d/transforms/base.py", line 45, in call
sample = t(sample)
File "/home/lucas/.conda/envs/paddle/lib/python3.9/site-packages/paddle3d-1.0.0-py3.9.egg/paddle3d/transforms/reader.py", line 185, in call
im_shape = cv2.imread(str(im_path)).shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
可以确定路径没错,单独使用cv2.imread也能读取图片数据,在ai studio上也能顺利运行,但是在我的本地会发生如上报错
The text was updated successfully, but these errors were encountered: