赞
踩
出现这个问题就说明。tensorflow的版本有问题,
tf.compat.v2 module was added in 1.14. Upgrade to 1.14 , 1.15, or 2.0 and this will work fine.
!pip install tensorflow==1.15 import tensorflow.compat.v2 as tf