tensorflow的自我学习问题

①module ‘tensorflow’ has no attribute ‘initialize_all_variables’
解决:initialize_all_variables改成tf.compat.v1.global_variables_initializer()

②module ‘tensorflow’ has no attribute ‘Session’
解决:tf.'Session’改成tf.compat.v1.Session()

③loss` passed to Optimizer.compute_gradients should be a function when eager execution is enabled
添加:tf.compat.v1.disable_eager_execution()

④ 1.AttributeError: module ‘tensorflow’ has no attribute ‘random_uniform’
解决:将’random_uniform’改为’random.uniform’即可正确运行

⑤2.1 AttributeError: module ‘tensorflow_core._api.v2.train’ has no attribute ‘GradientDescentOptimizer’
解决:optimizer = tf.compat.v1.train.GradientDescentOptimizer(0.5)

6、Tensorflow计算正确率、精确率、召回率、虚警率和漏检率
参考:https://blog.csdn.net/sinat_35821976/article/details/81334181

7、unindent does not match any outer indentation level 显示是制表符问题/缩进问题

8、np.transpose()函数python计算转置矩阵

9、矩阵转一维数组: 多维数组multiple_list 转一维数组reslut_list
reslut_list= multiple_list .flatten()

10、np.random.choice()细节https://blog.csdn.net/ImwaterP/article/details/96282230

11、Tensorflow中的损失函数loss汇总参考https://blog.csdn.net/qionggaobi9328/article/details/99171936?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522158644092319725219928923%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=158644092319725219928923&biz_id=0&utm_source=distribute.pc_search_result.none-task-blog-soetl_so_first_rank_v2_rank_v25-2

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值