You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

InstallPython.md 4.3 kB

4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # 安装Python环境
  2. 由于Python的库比较多,并且依赖关系比较复杂,所以请仔细阅读下面的说明,并按下面的说明来操作,减少问题出现的可能。 **但是所列的安装方法说明里有较多的细节,也许和你的系统并不适配,所以可能会遇到问题。如果遇到问题请通过搜索引擎去查找解决的办法**,并通过这个方式锻炼自己解决问题的能力。
  3. 可以参考后面所列的`1.Winodws`或者`2.Linux`章节所列的将Python环境安装到计算机里。
  4. ## 1. Windows下安装
  5. 由于Anaconda集成了大部分的python包,因此能够很方便的开始使用。由于网络下载速度较慢,因此推荐使用镜像来提高下载的速度。镜像的使用方法可以参考:[Anaconda镜像的说明文档](https://mirrors.bfsu.edu.cn/help/anaconda/)
  6. 1. 在这里找到适合自己的安装文件,然后下载
  7. https://mirrors.bfsu.edu.cn/anaconda/archive/
  8. 例如: https://mirrors.bfsu.edu.cn/anaconda/archive/Anaconda3-2020.11-Windows-x86_64.exe
  9. 2. 按照说明,把Anaconda安装好。
  10. ## 2. Linux下安装
  11. 在网站下载最新的conda安装文件,例如
  12. ```
  13. wget https://mirrors.bfsu.edu.cn/anaconda/archive/Anaconda3-2020.11-Linux-x86_64.sh
  14. ```
  15. 然后运行
  16. ```
  17. bash ./Anaconda3-2020.11-Linux-x86_64.sh
  18. ```
  19. 按照提示完成安装(记得需要`自动加入环境变量`的设置),**然后关闭终端,再打开终端**
  20. ## 3. 设置软件源
  21. ### 3.1 设置conda软件源
  22. 参考这里的[conda安装和软件源设置说明](https://mirrors.bfsu.edu.cn/help/anaconda/)
  23. 各系统都可以通过修改用户目录下的 `.condarc` 文件。Windows 用户无法直接创建名为 `.condarc` 的文件,可先执行 `conda config --set show_channel_urls yes` 生成该文件之后再修改。
  24. Linux下,打开文件编辑器 `gedit ~/.condarc`,然后把下面的内容拷贝到这个文件中:
  25. ```
  26. channels:
  27. - defaults
  28. show_channel_urls: true
  29. default_channels:
  30. - https://mirrors.bfsu.edu.cn/anaconda/pkgs/main
  31. - https://mirrors.bfsu.edu.cn/anaconda/pkgs/r
  32. - https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2
  33. custom_channels:
  34. conda-forge: https://mirrors.bfsu.edu.cn/anaconda/cloud
  35. msys2: https://mirrors.bfsu.edu.cn/anaconda/cloud
  36. bioconda: https://mirrors.bfsu.edu.cn/anaconda/cloud
  37. menpo: https://mirrors.bfsu.edu.cn/anaconda/cloud
  38. pytorch: https://mirrors.bfsu.edu.cn/anaconda/cloud
  39. pytorch-lts: https://mirrors.bfsu.edu.cn/anaconda/cloud
  40. simpleitk: https://mirrors.bfsu.edu.cn/anaconda/cloud
  41. ```
  42. ### 3.2 设置PIP源
  43. ```
  44. pip config set global.index-url 'https://mirrors.aliyun.com/pypi/simple/'
  45. ```
  46. ## 4. 安装常用软件
  47. 打开`conda`的命令行程序,输入下面的命令
  48. ```
  49. conda install jupyter scipy numpy sympy matplotlib pandas scikit-learn
  50. ```
  51. ## 5. 安装PyTorch
  52. ```
  53. conda install pytorch -c pytorch
  54. pip3 install torchvision
  55. ```
  56. ## 6. Conda使用技巧
  57. ### 6.1 Conda创建自己的环境
  58. ```
  59. conda create -n <your_env>
  60. # example
  61. conda create -n machinelearning
  62. ```
  63. ### 6.2 Conda怎么激活自己的环境
  64. ```
  65. conda activate <your_env>
  66. # example
  67. conda activate machinelearning
  68. ```
  69. ### 6.3 Conda常用命令
  70. ```
  71. # 帮助命令
  72. conda -h
  73. conda help
  74. # 配置频道(已有)
  75. conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/
  76. # 退出当前环境
  77. conda deactivate
  78. # 查看基本信息
  79. conda info
  80. conda info -h
  81. # 查看当前存在环境
  82. conda env list
  83. conda info --envs
  84. # 删除环境
  85. conda remove -n <your_env> --all
  86. ```
  87. ## 7. 安装nvidia驱动
  88. ### 7.1 查看已有的nvidia驱动
  89. ```
  90. dpkg -l | grep -i nvidia
  91. ```
  92. ### 7.2 卸载驱动
  93. ```
  94. sudo apt-get purge nvidia-driver-xxx
  95. ```
  96. ### 7.3 搜索并安装的驱动
  97. ```
  98. apt-cache search nvidia | grep 460
  99. sudo apt-get install nvidia-driver-460
  100. ```
  101. 根据自己的需要可以安装更高的版本。
  102. #### 7.4 Conda使用cuda
  103. ```
  104. conda install cudatoolkit=8.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
  105. ```
  106. **根据自己的需要安装更高的版本**
  107. ## 8. [Python技巧](python/)
  108. - [pip的安装、使用等](python/pip.md)
  109. - [virtualenv的安装、使用](python/virtualenv.md)
  110. - [virtualenv便捷管理工具:virtualenv_wrapper](python/virtualenv_wrapper.md)

机器学习越来越多应用到飞行器、机器人等领域,其目的是利用计算机实现类似人类的智能,从而实现装备的智能化与无人化。本课程旨在引导学生掌握机器学习的基本知识、典型方法与技术,通过具体的应用案例激发学生对该学科的兴趣,鼓励学生能够从人工智能的角度来分析、解决飞行器、机器人所面临的问题和挑战。本课程主要内容包括Python编程基础,机器学习模型,无监督学习、监督学习、深度学习基础知识与实现,并学习如何利用机器学习解决实际问题,从而全面提升自我的《综合能力》。