Python中文
首页
教程
问答
标签
搜索
登录
注册
“ImageDataGenerator”对象没有“flow”“from”“dataframe”“属性”
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在为癌症检测Kaggle挑战建立一个图像分类器。这是我正在使用的代码。在</p> <pre><code>`train_datagen = ImageDataGenerator(rescale=1./255, validation_split=0.15 ) test_datagen = ImageDataGenerator(rescale=1./255) train_path = MAIN_DIR + '/CancerTrain' valid_path = MAIN_DIR + '/CancerTrain' train_generator = train_datagen.flow_from_dataframe( dataframe = train_labels, directory=train_path, x_col = 'id', y_col = 'label', has_ext=False, subset='training', target_size=(96, 96), batch_size=64, class_mode='binary' ) validation_generator = train_datagen.flow_from_dataframe( dataframe=df, directory=valid_path, x_col = 'id', y_col = 'label', has_ext=False, subset='validation', # This is the trick to properly separate train and validation <a href="https://www.cnpython.com/pypi/dataset" class="inner-link">dataset</a> target_size=(96, 96), batch_size=64, shuffle=False, class_mode='binary' )` </code></pre> <p>但是,每当我运行它时,都会出现以下错误:</p> ^{pr2}$ <p>我到处找遍了,似乎找不到解决办法。这个方法现在叫什么不同了吗?在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>我在使用keras2.1.4时也遇到了同样的错误。我只是用<code>pip install keras upgrade</code>升级。Keras 2.2.4没有给出相同的错误。现在一切都好了。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何添加虚拟方法
1 回答
如何添加表示整数的擦边字符串?
10 回答
如何添加要在Bokeh中使用的新font.ttf文件?
4 回答
如何添加要显示的矩阵XY轴编号和XY轴
9 回答
如何添加计数?
1 回答
如何添加计数器函数?
9 回答
如何添加计数器列来计算数据帧中另一列中的特定值?
2 回答
如何添加计数器来跟踪while循环中的月份和年份?
9 回答
如何添加计数并删除countplot的顶部和右侧脊椎?
7 回答
如何添加计时器wx.应用程序更新窗口对象的主循环?
8 回答
如何添加评论到帖子?PostDetailVew,Django 2.1.5
2 回答
如何添加评论拉梅尔亚姆
8 回答
如何添加诸如矩阵Python/Pandas之类的数据帧?
2 回答
如何添加谷歌地点自动完成到Flask?
10 回答
如何添加超时、python discord bot
7 回答
如何添加超过1dp的检查
7 回答
如何添加距离方法
10 回答
如何添加跟随游戏的敌人精灵
8 回答
如何添加路径以便python可以找到程序?
2 回答
如何添加身份验证/安全性以使用happybase访问HBase?
6 回答