课程地址:http://campus.swarma.org/gvid=10351
Linux Version:GNU/Linux 4.10.0-35-generic x86_64
Python Version: 3.5.3
翻译自:https://www.anaconda.com/what-is-anaconda/
Anaconda是最流行的Python数据科学平台
Anaconda是有超过450万使用者的开源分发框架。它的conda包和虚拟环境管理是专门为Python数据科学及机器学习而设计的。只需要用一个简单的conda install命令,就能快速搭建数据科学/机器学习运行环境如Scikit-Learn和TensorFlow。
你只需要拿到对应操作系统的包即可编译使用,我们保证了跨平台之间的结果一致。现在知识库里有多达1000多个数据科学包可供使用,社区(anaconda.org)本身也正正生产更多的包。
Anaconda的商业化产品Anaconda Enterprise,可帮助组织搭建Python+R的企业级IT环境,支持多种上线方案如笔记本,应用,仪表盘,机器学习模型和大数据接口(Kubernetes,Hadoop,Spark)。
01-P1
wget 'https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh'
bash /root/Anaconda3-5.0.1-Linux-x86_64.sh
后按提示操作即可
如:
export PATH="/root/anaconda3/bin:$PATH"
conda create -n deep python=3.6 pandas numpy matplotlib jupyter notebook
deep为虚拟环境名称
设定环境为python3.6
加载一系列软件包:pandas numpy matplotlib jupyter notebook
source activate deep
参考官网
Tensors and Dynamic neural networks in Python with strong GPU acceleration.
PyTorch is a deep learning framework that puts Python first.
We are in an early-release Beta. Expect some adventures.
三大特点:
执行安装命令
conda install pytorch torchvision -c soumith
为了可以使用浏览器远程登录到服务器使用,下面的步骤以此为目标。
jupyter notebook --generate-config
from notebook.auth import passwd
passwd()
之后会获取到一串 'sha1...' 的密文,保存起来
# 打开文件修改
vim ~/.jupyter/jupyter_notebook_config.py
# 添加代码
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha1...填入密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888
jupyter notebook
在jupyter notebook的界面中
Ctrl+C然后按y可退出jupyter notebook的运行
退出虚拟环境:
deactivate deep
再次运行:
source activate deep
jupyter notebook
Anaconda编程环境
出现MemoryError错误的解决方案
# check free ram size
free -m
# create swap file of 512 MB
dd if=/dev/zero of=/swapfile bs=1024 count=524288
# modify permissions
chown root:root /swapfile
chmod 0600 /swapfile
# setup swap area
mkswap /swapfile
# turn swap on
swapon /swapfile