简体   繁体   English

带有 Theano 后端的 Keras

[英]Keras with Theano BackEnd

im new to Keras in python, i got this warning message when after executing my code.我是 Python 中的 Keras 新手,在执行我的代码后收到此警告消息。 I tried to search on google, but still didnt manage to solve this problem.我试图在谷歌上搜索,但仍然没有设法解决这个问题。 Thank you in advance.先感谢您。

UserWarning: he "show_accuracy" argument is deprecated, instead you should pass the "accurac " metric to the model at compile time: model.compile(optimizer, loss, metrics=["accuracy"]) warnings.warn('The "show_accuracy" argument is deprecated, ' UserWarning:不推荐使用“show_accuracy”参数,您应该在编译时将“accurac”指标传递给模型:model.compile(optimizer, loss, metrics=["accuracy"]) warnings.warn('The "show_accuracy" " 参数已被弃用,'

In Keras < 1.0 (I believe), one would pass the show_accuracy argument to model.fit in order to display the accuracy during training.在 Keras < 1.0(我相信)中,可以将 show_accuracy 参数传递给 model.fit 以显示训练期间的准确性。

This method has been replaced by metrics, as you can now define custom metrics that can help you during training.此方法已被指标取代,因为您现在可以定义可在训练期间为您提供帮助的自定义指标。 One of the metrics is of course, accuracy.衡量标准之一当然是准确性。 The changes to your code to keep the same behavior are minimum:为保持相同行为而对代码所做的更改最少:

  • Remove show_accuracy from the model.fit call.从 model.fit 调用中删除 show_accuracy。
  • Add metrics = ["accuracy"] to the model.compile call.将 metrics = ["accuracy"] 添加到 model.compile 调用中。

And that's it.就是这样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM