擅长:python、mysql、java
<p>如果您想使用<code>flow_from_dataframe()</code>方法,我建议您执行以下操作:</p>
<p>卸载当前keras预处理模块:</p>
<pre><code>pip uninstall keras-preprocessing
</code></pre>
<p>从以下git链接安装keras预处理模块:</p>
^{2}$
<p>(您可以看到方法是可用的<a href="https://github.com/keras-team/keras-preprocessing/blob/master/keras_preprocessing/image/image_data_generator.py" rel="nofollow noreferrer">in the source code here</a>)</p>
<p>然后导入<code>ImageDataGenerator</code>,如下所示:</p>
<pre><code>from keras_preprocessing.image import ImageDataGenerator
</code></pre>