我的老师告诉我们班级要制作一个基本的图像分类器,即使目录存在于硬盘驱动器上,我也无法正确尝试引用目录的路径。我尝试重命名目录,甚至直接从 Properties 复制路径,以确保我没有引用错误的目录。import osimport cv2 DATADIR = "D:\Datasets\PetImages"CATEGORIES = ['Cat, Dog']for category in CATEGORIES: path = os.path.join(DATADIR, category) for img in os.listdir(path): img_array = cv2.imread(os.path.join(path,img), cv2.IMREAD_GRAYSCALE)即使我认为我正确引用了目录,我仍然收到以下错误代码。FileNotFoundError: [WinError 3] The system cannot find the path specified: 'D:\\Datasets\\PetImages\\Cat, Dog'
添加回答
举报
0/150
提交
取消