【问题标题】:FileNotFoundError: [WinError 3] The system cannot find the path specified: './train'FileNotFoundError: [WinError 3] 系统找不到指定的路径:\'./train\'
【发布时间】:2022-12-11 18:46:25
【问题描述】:

train_datagen = ImageDataGenerator(rescale=1./255, rotation_range=10, zoom_range=0.1, horizo​​ntal_flip=False,fill_mode="最近") test_datagen = ImageDataGenerator(rescale=1./255, rotation_range=10,zoom_range=0.1, horizo​​ntal_flip=False,fill_mode="最近") training_set = train_datagen.flow_from_directory('./train', target_size=(150, 150), batch_size=40, class_mode='categorical') test_set = test_datagen.flow_from_directory('./test', target_size=(150, 150), batch_size=40, class_mode='categorical') 打印(len(training_set.filenames))

我尝试提供数据集目录,但对我没有用

【问题讨论】:

    标签: python-3.10


    【解决方案1】:

    看起来代码正在尝试访问当前工作目录中名为“train”的目录,但该目录不存在。

    这是 FileNotFoundError 的原因。

    您必须在当前工作目录中创建一个“train”目录,或者指定包含训练数据的目录的不同路径。

    【讨论】:

      猜你喜欢
      • 2018-12-03
      • 2020-01-29
      • 2022-01-23
      • 2021-10-13
      • 2021-08-20
      • 2020-06-03
      • 2023-01-25
      • 1970-01-01
      • 2022-11-17
      相关资源
      最近更新 更多