Keras 刚刚警告我:
用户警告:与批量更新 (0.988304) 相比,方法 on_batch_end() 速度较慢。检查您的回调。
我的 keras 脚本中没有回调,但我正在使用DataGenerator( keras.utils.Sequence)。这可能是个问题吗?
对于DataGenerator,我已经实现__init__(),__len__(),__getitem()__,和on_epoch_end方法。
对于on_epoch_end,我有:
def on_epoch_end(self):
"""
This method will be called between every epoch, so we can shuffle the
indexes here.
"""
self.indexes = np.arange(len(self.image_names))
if self.shuffle:
np.random.shuffle(self.indexes)
Run Code Online (Sandbox Code Playgroud)
完整的调用栈如下:
使用 TensorFlow 后端。/var/lib/condor/execute/slot1/dir_30551/anaconda/envs/cellimage/lib/python3.6/site-packages/skimage/transform/_warps.py:84: UserWarning: 默认模式,'constant',将在 skimage 0.15 中更改为“反射”。
warn("默认模式,'constant',将在" /var/lib/condor/execute/slot1/dir_30551/anaconda/envs/cellimage/lib/python3.6/site-packages/keras 中更改为'reflect' /callbacks.py:120: UserWarning: 方法 on_batch_end() 比批量更新慢 (0.586719)。检查你的回调。% delta_t_median)
/var/lib/condor/execute/slot1/dir_30551/anaconda/envs/cellimage/lib/python3.6/site-packages/keras/callbacks.py:120: UserWarning: Method on_batch_end() 与批量更新相比速度较慢(0.988304)。检查您的回调。% delta_t_median)
这可能与您的verbose.
我看到的都是一样的。我相信这是因为我需要verbose=1调用fit()- 即打印进度条和当前统计数据是一项耗时太长的批处理任务。这个假设得到了证据的支持,即如果我设置verbose=2了只在纪元结束时打印或verbose=0根本不打印,警告就会停止。如果我增加批量大小,警告也会停止。
| 归档时间: |
|
| 查看次数: |
10333 次 |
| 最近记录: |