简体   繁体   English

如何加载我们自己的数据集进行训练

[英]How to load our own data set for training

I want to train a model that will tell us the PM2.5(this value describe AQI) of any image.我想训练一个模型来告诉我们任何图像的 PM2.5(这个值描述 AQI)。 For this I use CNN.为此,我使用 CNN。 I am using tensorflow for this purpose.为此,我正在使用 tensorflow。 I am new in this field.Please tell me how we upload our own dataset and separate its name and tags.我是这个领域的新手。请告诉我我们如何上传我们自己的数据集并将其名称和标签分开。 The format of image name is "imageName_tag"(eg ima01_23.4)图片名称格式为“imageName_tag”(例如ima01_23.4)

I think we need more information about your case regarding the "how upload our own dataset".我认为我们需要更多关于“如何上传我们自己的数据集”的案例的信息。

However, if your dataset is on your computer and you want to access it from python, i invite you to take a look at the libraries "glob" and "os".但是,如果您的数据集在您的计算机上并且您想从 python 访问它,我邀请您查看库“glob”和“os”。

To split the name (which in your case is "imageName_tag") you can use:要拆分名称(在您的情况下是“imageName_tag”),您可以使用:

string = "imageName_tag"
name, tag = string.split('_')

As you'll have to do it for all your data, you'll have to use it in a loop and store the extracted informations in lists.由于您必须为所有数据执行此操作,因此您必须循环使用它并将提取的信息存储在列表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM