①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