简介
TensorFlow 是一个端到端开源机器学习平台。它拥有一个全面而灵活的生态系统,其中包含各种工具、库和社区资源,可助力研究人员推动先进机器学习技术的发展,并使开发者能够轻松地构建和部署由机器学习提供支持的应用。那它能干什么用呢?
- 轻松地构建模型:在即刻执行环境中使用 Keras 等直观的高阶 API 轻松地构建和训练机器学习模型,该环境使我们能够快速迭代模型并轻松地调试模型。
- 随时随地进行可靠的机器学习生产:无论您使用哪种语言,都可以在云端、本地、浏览器中或设备上轻松地训练和部署模型。
- 强大的研究实验:一个简单而灵活的架构,可以更快地将新想法从概念转化为代码,然后创建出先进的模型,并最终对外发布。
一. Aconada安装
下载Aconada镜像地址: https://mirror.tuna.tsinghua.edu.cn/help/anaconda/



如果安装了numpy记得卸载,每个tensorflow对应的numpy版本不同。
卸载命令: pip3 uninstall numpy

给文件记得授予权限,此处给的是777,然后执行sh文件

关于此处为何要改安装位置,是因为小编的根目录下内存已满。可以使用df -h 命令查看。


看到这样的提示即安装成功。
二. 配置conda环境变量


三. TensorFlow安装
在命令行中使用以下命令创建 conda 环境:
conda create -n tensorflow python=3.5 (请对应自己python版本,这儿忘截图了,用另一台虚拟机截的图)


上图报错,需要配置源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
如果还是不行,将https换为http


从镜像源处下载tensorflow并安装,镜像源地址:
https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/tensorflow/
找到对应自己python版本的文件,复制文件名到路径,命令为:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-manylinux1_x86_64.whl

此命令不适合python3.8,小编尝试失败了。下载下来运行提示需要安装依赖的库,比较多。


tensorflow至此安装完毕。
四. 问题整理
一. No space left on device

解决方案:扩展空间,并设置自启动挂载



以上就是Python3安装tensorflow的详细内容,更多关于Python3安装tensorflow的资料请关注社区其它相关文章! |