No module named 'tensorflow.contrib'

命令行报错如下:

import tensorflow.contrib.slim as slim
ModuleNotFoundError: No module named 'tensorflow.contrib'

tensorflow 2.0以后没有 tensorflow.contrib

解决办法:
降低版本后问题解决

pip uninstall tensorflow         #卸载tensorflow
pip install tensorflow==1.14.0   #安装tensorflow 1.13.1

你可能感兴趣的:(No module named 'tensorflow.contrib')