libpng error: IDAT: CRC error

import cv2
import os

img = cv2.imread('/cloud_disk/users/huh/dataset/cityscapes/leftImg8bit/val/lindau/lindau_000043_000019_leftImg8bit.png', -1) # (shape: (1024, 2048, 3))

读取图片出现:

libpng error: IDAT: CRC error

同时报错(实时语义分割任务):

img = cv2.resize(img, (self.new_img_w, self.new_img_h),
cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/resize.cpp:4052: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
 

使用Image.open()改变了图片的类型,训练没成功,后来直接把图片删除了

你可能感兴趣的:(机器学习,python,深度学习,机器学习,python)