import tensorflow.contrib.slim as slim ModuleNotFoundError: No module named 'tensorflow.contrib'
时间: 2023-08-27 18:16:56 浏览: 118
引用中的报错信息显示,在代码中使用了tensorflow.contrib.slim模块,但是系统找不到这个模块,导致报错。而引用提供了一个解决方案,即将import tensorflow.contrib.slim as slim 改为 import tf_slim as slim,这样可以成功解决该报错。此外,引用还提供了另外一个解决方案,即降低tensorflow版本。你可以使用命令pip uninstall tensorflow卸载当前版本,然后使用pip install tensorflow==1.14.0安装tensorflow 1.14.0版本来解决该问题。这两种解决方案可以根据具体情况选择其中一种来解决导入模块报错的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ModuleNotFoundError: No module named ‘tensorflow.contrib](https://blog.csdn.net/qq_38251616/article/details/114820099)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [不降级解决ModuleNotFoundError: No module named ‘tensorflow.contrib](https://blog.csdn.net/Rex__404/article/details/112798943)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文