基于docker的TensorFlow开发环境搭建
来源:互联网 发布:剑灵帅气灵男捏脸数据 编辑:程序博客网 时间:2024/04/28 17:32
1 Ubuntu平台
对于ubuntu12.04的安装需要增加ubuntu的下载源
1.1 编辑下载源:在/etc/apt/sources.list文件中增加以下命令行
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
1.2 新下载源
sudo apt-get update
1.3 问题处理
- FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
- 其他FATA[0000] 问题
解决方案:sudo apt-get install apparmor
2 Windows平台
windows直接安装dockertoolbox即可
https://www.docker.com/products/docker-toolbox
推荐版本为ubuntu 14.04,内核版本不低于
3 TensorFlow镜像下载运行
sudo docker pull tensorflow/tensorflow
bash方式:sudo docker run -it tensorflow/tensorflow bash
web方式:docker run -it -p 8888:8888 tensorflow/tensorflow
通过http://IP地址:8888进行访问
4 TensorFlow程序
镜像中没有vi或者vim编辑工具,直接使用Python脚本交互式运行一下脚本得到输出结果,中间存在警告,目前已经忽略。
#Pythonimport tensorflow as tfhello = tf.constant("Hello, TensorFlow!");sess = tf.Session();print(sess.run(hello));
中间的警告如下:
2017-08-21 10:45:47.379464: W tensorflow/core/platform/cpu_feature_guard.cc:45]The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.2017-08-21 10:45:47.379519: W tensorflow/core/platform/cpu_feature_guard.cc:45]The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.2017-08-21 10:45:47.379536: W tensorflow/core/platform/cpu_feature_guard.cc:45]The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
输出结果如下:
hello, TensorFlow!
4 参考链接
[1] https://www.w3cschool.cn/docker/ubuntu-docker-install.html
- 基于docker的TensorFlow开发环境搭建
- 基于docker的环境搭建
- Ubuntu14.04下基于nvidia-docker的Tensorflow深度学习环境搭建
- 机器学习tensorflow和sonnet环境的搭建windows/linux/OS X 基于docker
- 基于docker的caffe环境搭建
- 搭建 Tensorflow 开发环境
- Docker 搭建开发环境
- Docker 搭建开发环境
- 基于Docker的PHP开发环境
- 基于docker的webrtc开发环境
- 深入浅出Docker(五):基于Fig搭建开发环境
- 深入浅出Docker(五):基于Fig搭建开发环境
- 在Linux下搭建基于Docker的LNMP+Redis的开发环境
- 在Linux下搭建基于Docker的LNMP+Redis的开发环境
- 基于docker搭建测试环境
- 基于Docker搭建LNMP环境
- 基于CentOS搭建Docker环境
- Windows下搭建基于Anaconda的Tensorflow环境
- JAVA开发的23种设计模式之 — 责任链模式
- 单向链表-创建
- Java读取文件----中文乱码问题
- Java基础对象、bean、spring boot
- 字典循环训练
- 基于docker的TensorFlow开发环境搭建
- Oracle笔记
- [HNOI2015]菜肴制作 拓扑序
- IO复用(Reactor模式和Preactor模式)——用epoll来提高服务器并发能力
- 生成代码文档图—doxygen graphviz
- Ajax原生Xhr(xmlhttprequest)
- Jenkens配置Git遇到的问题
- 创建线程的三种方式
- 基于HBase的云盘项目复制功能总结