gpt4 book ai didi

python-3.x - 属性错误: module 'tensorflow' has no attribute 'streaming_accuracy'

转载 作者:行者123 更新时间:2023-11-30 09:09:46 24 4
gpt4 key购买 nike

accuracy = tf.streaming_accuracy (y_pred,y_true,name='acc')
recall = tf.streaming_recall (y_pred,y_true,name='acc')
precision = tf.streaming_precision(y_pred,y_true,name='acc')
confusion = tf.confuson_matrix(Labels, y_pred,num_classes=10,dtype=tf.float32,name='conf')

对于上面的代码,我在过去几天收到了同样的错误。语法和tensorflow API文档中的语法不一样吗?

最佳答案

尝试使用它(在一个新的 python 文件中,我建议创建一个 /tmp/temp.py 并运行它)

from tensorflow.contrib.metrics import streaming_accuracy

如果这不起作用,那么

  1. 安装有问题(在这种情况下重新安装)
  2. 或者您导入了错误的tensorflow模块。

关于python-3.x - 属性错误: module 'tensorflow' has no attribute 'streaming_accuracy' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42628141/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com