没有子文件夹的Keras图像 [英] Keras images with no subfolders
问题描述
我是深度学习的新手。我有一个问题:我正在尝试使用此数据来训练网络。一切都在一个文件夹中,标签在另一个mat文件中。
I am new to Deep Learning. I have this question: I am trying to train a network with this data. Everything is in one folder and labels are in a different mat file.
我了解我可以使用scipy.io读取数据。但是,如何将火车X放在一个文件夹中?如果我使用内置的flow_from_directory,则它不会显示图像,因为每个类都应该有自己的文件夹。
I understand that I can read the data with scipy.io. But how can I get train X in one folder? If I use the built in flow_from_directory it shows no images, because every class should have it's own folder.
如何仅使用一个文件夹创建X?现在它显示找到了0个属于0类的图像
How can I create X with only one folder? Now it shows Found 0 images belonging to 0 classes
只有一个包含图像的文件夹。所有图像都在1个文件夹中。我的意思是没有classes文件夹。使用flow_from_directory,您应该拥有类似于car / mercedes,cars / bmw,cars / audi之类的东西,但是我的数据没有子文件夹。
There is just a folder with images. All images are in 1 folder. I mean there is no classes folder. With flow_from_directory you should have something like cars/mercedes, cars/bmw, cars/audi, but my data doesn't have subfolders.
所以我的问题还有创建X数据的其他方法吗?
So my question is there any other way to create X data?
推荐答案
将类设置为无
,并将所有图像放入图像文件夹的一个子文件夹中。
Set classes to None
and put all images into one subfolder of your image folder.
例如:
-
flow_from_directory(directory = / path / to / your / images /,class_mode = None,…)
- 将图像放入
/ path / to / your / images / data
flow_from_directory(directory = "/path/to/your/images/", class_mode="None", …)
- put your images into
/path/to/your/images/data
这篇关于没有子文件夹的Keras图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!