我有以下代码,我需要 opencv 读取文件夹中的文件。
filename = 'C:/Users/test_image'
files = filename
for file in files:
orig = cv2.imread(file)
image = image_utils.load_img(file, target_size=(224,224))
image = image_utils.img_to_array(image)
我正在检索以下错误。
test_imagenet.py:26: in <module>
image = image_utils.load_img(file, target_size=(224, 224))
..\..\miniconda3\envs\tensorflow\lib\site-packages\keras_preprocessing\image\utils.py:110: in
load_img
img = pil_image.open(path)
..\..\miniconda3\envs\tensorflow\lib\site-packages\PIL\Image.py:2809: in open
fp = builtins.open(filename, "rb")
E FileNotFoundError: [Errno 2] No such file or directory: 'C'
collected 0 items / 1 error
非常感谢您的帮助。谢谢
慕尼黑5688855
相关分类