我正在研究来自“APTOS 2019盲人检测”的kaggle数据集,数据集在一个zip文件中。我想对数据集进行预处理,以输入到深度学习模型中。在
我的代码如下:
train_dir = '../input/train_images'
train_labels = pd.read_csv('../input/train.csv')
train_labels['diagnosis'] = train_labels['diagnosis'].astype(str)
test_dir = '../input/test_images'
然后为了预处理,我写了:
^{pr2}$但当我运行代码时。我得到的结果是:
找到0个属于0类的已验证图像文件名。
找到0个属于0类的已验证映像文件名。在
我也尝试过解压文件,但它不会解压说
FileNotFoundError:[Errno 2]没有这样的文件或目录:'train_图像.zip'
# importing required modules
from zipfile import ZipFile
# specifying the zip file name
file_name = "../input/train_images.zip"
# opening the zip file in READ mode
with ZipFile(file_name, 'r') as zip:
# extracting all the files
print('Extracting all the files now...')
zip.extractall()
有人能帮我解决这个问题吗?我会很感激的
您已经在目录
../home/train_images
在内核中运行:
使用
ImageDataGenerator.flow_from_directory()
将目录中的图像与生成器一起使用。检查Keras文档:https://keras.io/preprocessing/image/#imagedatagenerator-methods
相关问题 更多 >
编程相关推荐