docker_docker安装TOPT

在docker中安装TPOT机器学习包。

1,启动并进入docker

启动:john@john-PAY4:~$ docker run -d -p 8888:8888 -v /media/john/10167DFA167DE0E0/WPAN/GIT/PYTHON:/home/ds/notebooks dataquestio/python2-starter
查询id:docker ps
进入docker机器终端:sudo docker exec -it 775c7c9ee1e1(上一步查询的id) /bin/bash

2,安装TOPT

参考:https://github.com/rhiever/tpot/blob/master/docs_sources/installing.md

3,安装和验证deap

参考:https://github.com/DEAP/deap
pip install deap

(升级pip)pip install –upgrade pip
pip install git+https://github.com/DEAP/deap@master
成功后
docker机器中输入python,进入python终端,
from deap import creator
没有报错,认为安装成功。

4,安装tqdm和stopit

pip install tqdm stopit
20171219204803483

5,安装xgboost

参考:http://blog.csdn.net/sun_jiadong/article/details/50897020
pip install xgboost
20171219204804286

6,安装TPOT

pip install tpot

7,验证tpot安装

python
from tpot import TPOTClassifier
不报错即可。
20171219204806761

8,提交到新容器

docker ps -l
docker commit 5209(上一步id的前4位) learn/tpot
docker imges

9,docker镜像的备份

参考:http://blog.csdn.net/chaimyu/article/details/53509554
先查看有哪些images:

1
2
3
4
5
6
[dev@OG2233-FM41-226 ~]$ sudo docker images  
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
sameersbn/gitlab 8.14.2 3dc4358e3a23 4 days ago 778.1 MB
sameersbn/postgresql latest 38f559f86963 7 weeks ago 232.4 MB
sameersbn/mysql latest 3e1a2409cf94 7 weeks ago 294.1 MB
sameersbn/redis latest 4c37d50ffad3 7 weeks ago 196.5 MB

保存image:

1
[dev@OG2233-FM41-226 ~]$ sudo docker save -o ./gitlab-8.14.2.tar sameersbn/gitlab

这个操作根据image大小,可能比较慢,也可能这机器太慢…
[dev@OG2233-FM41-226 ~]$ ls
gitlab-8.14.2.tar
恢复image:

1
sudo docker load -i ./gitlab-8.14.2.tar

这样就能恢复了,不过没测试,先备份着等以后有需要时再用。

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×