目录
一句话介绍:为了进行机器学习快速开发,我们将使用python语言编程、anaconda管理不同的项目环境、jupyter notebook进行断点高效调试、不同的工具包快速搭建模型。
pip国内镜像源链接
- 阿里云 http://mirrors.aliyun.com/pypi/simple/
- 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
- 豆瓣(douban) http://pypi.douban.com/simple/
- 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
- 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
在使用pip的时候在后面加上-i参数,指定pip源
eg: pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple
核心工具介绍
python
Python是一种解释型的、面向对象的、移植性强的高级程序设计语言。
- 开发者:吉多·范罗苏姆(Guide van Rossum)
- 解释性:不需要编译成二进制代码,可以直接从源代码运行
- 面向对象:Python既支持面向过程的编程也支持面向对象的编程
- 可移植性:由于它的开源本质,可在不同平台进行开发
- 高层语言:无须考虑诸如如何管理程序使用的内存一类的底层细节
官网:www.python.org/
优点:简单易学、开发效率高、高级语言、可移植性、可扩展性、可嵌入性
缺点:速度慢、代码不能加密
Anaconda
Anaconda是一个方便的python包管理和环境管理软件
- 支持 Linux, Mac, Windows
- 可以很方便地解决多版本python并存、切换以及各种第三方包安装问题
特点:
- 跨平台、同时实现包管理、环境管理的功能
- 使用方便、环境部署步骤简单
Jupyter notebook
Jupyter Notebook是一个开源的Web应用程序,允许开发者方便的创建和共享代码文档。
- 可以实时写代码、运行代码、查看结果,并可视化数据
特点:
- 允许把代码写入独立的cell中,然后单独执行。用户可以在测试项目时单独测试特定代码块,无需从头开始执行代码
- 基于web框架进行交互开发,非常方便
基础工具包 Panda\Numpy\Matplolib
核心步骤
1、anaconda与python安装
2、虚拟环境部署
为方便后续开发,使用anaconda部署新的开发环境
2.1、enviroment》base》open terminal
2.2、 conda create -n env_name(比如把“machine_learning"替换"env_name")
2.3、安装numpy、scikit-learn库:pip(conda) install package_name
Anaconda及Python的安装
内容较长,部署教程:
机器学习入门与Python实战环境配置篇:Windows、mac os、Linux 安装 Anaconda与python: https://blog.csdn.net/dfly_zx/article/details/110189652
常见问题解决办法
操作系统
➢ 建议对使用的操作系统进行更新,如果系统版本过旧,可能导致软件安装失败 Python 与 tensorflow
版本
➢ 安装 3.7 python版本,版本并不是越高越高,使用 3.8 版本在深度学习部分可能存在安装包不 兼容问题。
➢ 安装 tensorflow 版本 2.0.0
Anaconda
➢ 建议以管理员身份运行安装文件
➢ 安装路径存不要包含空格、中文字符
➢ 安装失败可能是系统版本过旧导致,更新操作系统;或者尝试下载旧版本的 anaconda, 下载地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ Jupyter
➢ 浏览器建议使用 chrome,如果使用其他浏览器可能存在不兼容问题 如何导出自己原有浏览器的收藏夹:通常在浏览器右上角收藏夹按钮有导出选项,导出以后 再使用 chrome 导入即可
Jupyter
Jupyter 安装后登录失败(停留在加载页面):尝试重新安装开发环境,安装指令: conda create -n imooc_ai pyhon=3.7.0
➢ 存在访问外网首先导致下载超慢问题,可进行如下配置:
1)首先从Anaconda环境base打开 Anaconda Prompt
进入 会显示 (base) C:\Users\niubi>
2)然后 复制 conda config --set show_channel_urls yes 到里面
然后打开 c盘 用户的文件夹 里面的 个人文件夹
比如 C:\Users\niubi
3)点击 查看 里面的 隐藏项目
4)找到.condarc 的文件,打开并复制
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
channels:
- defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
变成这个样子
5) 刷新缓存 在第一步打开的终端里 复制
conda clean -i
如果现在就想开始学习机器学习,你还可以:
1、添加微信:ai_flare,领取Python编程课(AI方向)、Python实现机器学习,免费领取(仅限前100名)
2、人工智能学习路线:专为AI小白设计的人工智能实战课 - Python3入门人工智能 基础+实战 学习视频教程-CSDN学院