我正在使用Keras库处理我的神经网络错误。使用Dropout时,我收到了以下3条警告
WARNING:tensorflow: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer.
WARNING:tensorflow: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
WARNING:tensorflow: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead.
这是我如何使用模型中的辍学
model.add(Dropout(rate=0.2))
尽管这是一个警告,但我对此感到担心。以前,当我使用如下所示的辍学信息时,我再次收到警告
model.add(Dropout(0.2))
我应该怎么做才能摆脱这些警告?谁能帮我
答案 0 :(得分:1)
您无法真正摆脱这些警告,它们不是由您的代码生成的,而是由调用tf.nn.dropout
的内部keras代码生成的。这些警告不是给您的,而是给keras团队使用的,它们必须更新tensorflow后端才能删除这些警告。
摆脱警告的唯一方法是编辑keras的源代码。