报错解决:No module named tensorflow.contrib

今天在跑代码的时候发现一个报错,如下图所示

报错解决:No module named tensorflow.contrib_第1张图片

于是乎我就按照下面的提示安装啊,可惜的是,无效
报错解决:No module named tensorflow.contrib_第2张图片

然后我就去查了下自己的TensorFlow版本,是1.15,再看了下Readme.md,怀疑是不是版本太高了
在这里插入图片描述报错解决:No module named tensorflow.contrib_第3张图片
想到就做,换了个低版本的TensorFlow,具体操作请参考这篇博客https://blog.csdn.net/weixin_42455006/article/details/121021195
最后当然是报错解决了
报错解决:No module named tensorflow.contrib_第4张图片

PS:import tensorflow.contrib.keras as kr -> import keras as kr{参考:https://blog.csdn.net/KaelCui/article/details/106123927?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163746363216780255266178%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=163746363216780255266178&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-6-106123927.first_rank_v2_pc_rank_v29&utm_term=tensorflow.contrib报错&spm=1018.2226.3001.4187}

你可能感兴趣的:(错误集锦,pycharm,python,深度学习)