zjh__1的博客将import tensorflow as tf 改成import tensorflow.compat.v1 as tf(不要管ide的红线报错)import tf_slim as slim。添加tf.disable_v2_behavior()到首行即可修复。使用tensorflow 2.0以上版本,并且安装tf_slim。
AI-聂帅的博客AttributeError: in user code: C:/Users/Administrator/PycharmProjects/FAS-SGTD-master/fas_sgtd_multi_frame/generate_data_train.py:313 parser_fun... AttributeError: module 'tensorflow' has no attribute .
dramatic_D_的博客解决 module ‘tensorflow’ has no attribute 'compat’问题 做法:Tensorflow降版本 在学习之前要了解,这个问题为什么会发生,因为现在的Tensorflow都是2.X版本,网上的一些代码,都是大佬用1.X的版本下写的,...