在 keras 中使用 image_dataset_from_directory 时类计数错误

问题描述

我正在尝试使用 image_dataset_from_directory 从文件夹加载数据,但是当我加载数据时,我得到 3 个类而不是 2 个。我没有任何隐藏文件夹,这是我的文件夹结构

train
   cats
   dogs
test
  cats
  dogs

enter image description here

我无法理解如何解决此问题

更新

这就是我加载图像的方式
train_data=keras.preprocessing.image_dataset_from_directory('./sample_data/data/train')

google colab 共享链接 https://colab.research.google.com/drive/10OjdVSI9oTJWNw5CCIxxnZ4_a2zucDkY?usp=sharing

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)