FileNotFoundError:[WinError 3]系统找不到指定的路径'dataset / validation_setcellphone'

问题描述 投票:-1回答:1

testing error无法找出代码有什么问题。我也附上了代码的图像。帮助

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-17-eee1e2dec49b> in <module>
     41 for i in range(0, 15):
     42     path = 'dataset/validation_set'
---> 43     img, final_path, true_label = getRandomImage(path, img_height, img_width)
     44     files.append(final_path)
     45     true_labels.append(true_label)

<ipython-input-17-eee1e2dec49b> in getRandomImage(path, img_width, img_height)
     25     path_class = folders[random_directory]
     26     file_path = path + path_class
---> 27     file_names = [f for f in listdir(file_path) if isfile(join(file_path, f))]
     28     random_file_index = np.random.randint(0,len(file_names))
     29     image_name = file_names[random_file_index]

FileNotFoundError: [WinError 3] The system cannot find the path specified: 'dataset/validation_setcellphone'
python numpy matplotlib keras cv2
1个回答
0
投票

错误指示Python无法找到的路径:_dataset / validation_setcellphone _

© www.soinside.com 2019 - 2024. All rights reserved.