Problem solving module ‘ tensorflow.compat . V2 ‘has no attribute’ contrib ‘and importerror cannot import name’ auto ‘

The current version of tensorflow is 1.13.1 and 2.0.0b1 report errors module ‘tensorflow.compat.v2’ has no attribute ‘contrib’,

try to import tensorflow.compat.v1 as tf instead of import tensorflow as tf,

But ImportError cannot import name ‘auto’


as shown in the figure below, refer to article 1 to point out that tf2.0 alpha began to remove tf.contrib and needed to be upgraded.

therefore, upgrade to tensorflow 2.1.0 using PIP install –upgrade tensorflow.

reference article:


Read More: