导入 tensorflow 时没有名为“absl"的模块错误 [英] No module named 'absl' error when I import tensorflow

查看:150
本文介绍了导入 tensorflow 时没有名为“absl"的模块错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在装有 GTX1070 的 Win 7 机器上安装了 anaconda.

I have anaconda installed on my Win 7 machine with a GTX1070.

过去一个小时我一直在尝试安装 tensorflow gpu 版本,但没有成功.我按照 tensorflow 网站 上的教程没有成功.他们要求您安装 CUDA 8.0 和 Cudll 6.0,我这样做了.然后我将 cudnn64_6.dll、cudart64_80.dll 和 libnvvp 文件夹的位置添加到我的路径变量中.然后我在 conda 中设置了一个虚拟环境并运行以下命令:

I have been trying to install tensorflow gpu version for the past hour with no luck. I followed the tutorials on the tensorflow website to no success. They ask for you to install CUDA 8.0 and Cudll 6.0 which I do. I then add the location of cudnn64_6.dll, cudart64_80.dll and the libnvvp folder to my path variables. I then set up a virtual environment in conda and run the following command:

(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu 

我相信当我这样做时,它会安装 tensorflow 1.5,这似乎需要 CUDA 工具 9.0,因为我收到一条错误消息,说找不到 cudart64_80.dll.所以我将我的 CUDA 工具更新到 9.0 并下载相应的 Cuda 库.然后我更改我的路径变量.现在我没有收到任何丢失的 dll 错误,但是我现在面临以下错误

I believe when I do this, it installs tensorflow 1.5 which seems to require CUDA tools 9.0 because I get an error saying that cudart64_80.dll cannot be found. So I update my CUDA tools to 9.0 and download the corresponding Cuda library. I then change my path variables. Now I dont get any missing dll errors however, I am now faced with the following error

ModuleNotFoundError: No module named 'absl'

有人对我从这里开始可以做什么有任何建议吗?

Does anyone have any suggestions as to what I can do from here on?

推荐答案

这是由我的 Python 版本问题引起的.我在 Python 2.x 上安装了 absl 包,但我的 Python 3.x 没有.所以我只是确保我机器上的两个 Python 都安装了这个包:

This was caused by a Python version issue for me. I had the absl package installed on my Python 2.x, but my Python 3.x didn't have it. So I just made sure that both Pythons on my machine had the package installed:

pip install absl-py
pip3 安装 absl-py

这篇关于导入 tensorflow 时没有名为“absl"的模块错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆