machine-learning - Kaggle - 猫与狗(用户警告:在 x_col="filename" 中发现 20000 个无效图像文件名。这些文件名将被忽略。)
问题描述
我明白了
UserWarning: Found 20000 invalid image filename(s) in x_col="filename". These filename(s) will be ignored.
当我生成测试生成器时。
这是代码:
test_datagen = ImageDataGenerator(rotation_range=15,
rescale=1./255,
shear_range=0.1,
zoom_range=0.2,
horizontal_flip=True,
width_shift_range=0.1,
height_shift_range=0.1)
test_generator = train_datagen.flow_from_dataframe(train_df,
"./test/",x_col='filename',y_col='category',
target_size=Image_Size,
class_mode='categorical',
batch_size=batch_size)
测试文件夹就在文件之前。我已经搜索了很多来解决这个问题。如果代码中有任何错误,请指定或给我其他建议。
解决方案
所有 jpeg / png 名称必须按数字顺序排列,根据 ImageDataGenerator 中的 flow_from_dataframe,不允许使用字母数字标签。该图像将被忽略,并将发出该文件的警告。场景中的每个图像都有字母数字标签(csv 中的名称)。
推荐阅读
- arduino - 代码行 lcd.scrollDisplayLeft(); 不工作
- java - 我写了一个抵押计算器代码,但是当我调试它时出现异常
- reactjs - 如何使用 React 将 QR 码放入 PDF?
- ruby-on-rails - 来自url的带有查询的rails 6上的Json响应
- python - 根据另一个数据框数据生成列数据
- arrays - Get position of hash in array of hashes
- r - 如何在同一窗口中显示两个直方图,但在 R 中显示不同的图?
- python - 为什么 `|=` 似乎会改变一个 `set` 而长格式没有?
- go - nginx proxy_pass on / 使用 go app 给出 404
- android - TWA:尝试在域之间进行无缝导航但没有运气