Build a Python environment for beginners to learn AI/ML

Source: Internet
Author: User
Tags jupyter jupyter notebook

Unknowingly disappeared for a long time, the public number has not been updated. Because ran to learn the Microsoft AI direction of the MPP course. MPP is the first time Microsoft has offered a training course on AI, the learning system for MPP, and I'll write a brief introduction later.

???? MPP contains a lot of content, start learning time is very fast, to the back more and more difficult. This is one of the reasons why you haven't had the energy to update content for a long time. During the learning process, the Python environment required by AI or ML is gradually exposed. Do you remember the introduction we had before? Using Python to invoke many of the AI's APIs to quickly implement some of the AI's features.

??? While learning the edoc of Azure Ai's API, there are some sample code that uses Jupyter notebook to reflect. At that time, I think, I have python not just good? Learn the code in an authentic way. After "forcing" the use of notebook in the MPP course, it is true that this is a convenient way to learn. So, I'll try to read the code and add my own comment before I copy the sample code and run it. Notebook can write the notes or notes separately as a block in MD format. The code is broken down into another block of code. This makes it easy to read background information and notes while running debug code conveniently.

??? In addition, many AI or ML courses will also provide notebook help in notebook file format, so it is necessary to have a notebook environment. Let's try to build a notebook environment using the most complex building methods.

??? Remember when you first used vs code to write Python, the code format is scored, normalization is part of the learning code, so Pylint is still needed:
astroid-1.6.3/isort-4.3.4/lazy-object-proxy-1.3.1/mccabe-0.6.1/pylint-1.8.4/wrapt-1.10.11

??? So many AI APIs are provided as Web services, and the quick Call API is requests:

certifi-2018.4.16/chardet-3.0.4/idna-2.6/requests-2.18.4/urllib3-1.22

??? How can data processing be less numpy? What code seems to have an array ah ~
numpy-1.14.2

??? In the same way, pandas is also indispensable for processing ml data.

pandas-0.22.0/pytz-2018.4

??? All kinds of drawing show, no matplotlib?

cycler-0.10.0/kiwisolver-1.0.1/matplotlib-2.2.2/pyparsing-2.2.0

??? Install notebook complex point, rely on the library a bit more ~

markupsafe-1.0/send2trash-1.5.0/backcall-0.1.0/bleach-2.1.3/decorator-4.3.0/entrypoints-0.2.3/html5lib-1.0.1/ ipykernel-4.8.2/ipython-6.3.1/ipython-genutils-0.2.0/ipywidgets-7.2.1/jedi-0.12.0/jinja2-2.10/jsonschema-2.6. 0/jupyter-1.0.0/jupyter-client-5.2.3/jupyter-console-5.2.0/jupyter-core-4.4.0/mistune-0.8.3/nbconvert-5.3.1/ Nbformat-4.4.0/notebook-5.4.1/pandocfilters-1.4.2/parso-0.2.0/pickleshare-0.7.4/prompt-toolkit-1.0.15/pygments -2.2.0/python-dateutil-2.7.2/pywinpty-0.5.1/pyzmq-17.0.0/qtconsole-4.3.1/simplegeneric-0.8.1/terminado-0.8.1/ testpath-0.3.1/tornado-5.0.2/traitlets-4.3.2/wcwidth-0.1.7/webencodings-0.5.1/widgetsnbextension-3.2.1

??? And then to do the MPP experiment, naturally need Microsoft's AI Tool Library cntk~ course is also very strange, requires 2.0 version, the following course is required to update the version, first install 2.0

scipy-1.0.1/cntk-2.0

??? In fact, the above list so many libraries, not much significance, when using the PIP installation, will automatically follow the dependencies to install the required library. Then why do I have to list all these libraries? Two reasons, first, if we need to install offline; second, because of all the known reasons, when accessing the default library distribution, frequent interference with HTTPS traffic causes the download to fail. At this time can follow the above list, to PyPI website prescription.

??? Once installed, you will be able to use notebook to run locally.

??? Have you said so much that there is no more convenient way? Yes!

??? In fact, the MPP course uses Anaconda to build an environment for learning ai/ml. Use Anaconda to manage your environment conveniently and graphically. But I look at the installation file is already good hundreds of M, think of deformation of the poor 200G space, it is not installed.

???? So, is there any more convenient way? Yes!

???? Visit https://notebooks.azure.com? You don't have to pretend anything, you can use it when you open it.

???? After the course of ML, it is still a face that will take time to digest, but the environment needs to be updated. Updating CNTK is simple:

PS c:\windows\system32> pip Install CNTK--upgrade
Collecting CNTK
?? Downloading https://files.pythonhosted.org/packages/e0/66/ BD529934288094C4A4A7110FA6797669D95FFA7FC3687275A5541B80A281/CNTK-2.5.1-CP36-CP36M-WIN_AMD64.WHL (63.7MB)
???? 100% |████████████████████████████████| 63.7MB 181kb/s
Requirement not upgraded as is directly required:scipy>=0.17 in C:\Program Files\python36\lib\site-packages (from CNT k) (1.0.1)
Requirement not upgraded as is directly required:numpy>=1.11 in C:\Program Files\python36\lib\site-packages (from CNT k) (1.14.2)
Installing collected PACKAGES:CNTK
?? Found existing INSTALLATION:CNTK 2.0
???? Uninstalling cntk-2.0:
?????? Successfully uninstalled cntk-2.0
Successfully installed cntk-2.5.1

??? Since CNTK 2.0 was installed, the dependent scipy and numpy libraries were already up-to-date, so there was no automatic update. But I still manually brush to the latest version.

??? Then, you need to add OpenCV. To see the official website, the default support is Python 2.7 ... What's this all about? Turned over the Web page, seemingly unofficial library provided, since we all use, then don't hesitate, loaded on:

PS c:\windows\system32> pip Install Opencv_python
Collecting Opencv_python
?? Downloading https://files.pythonhosted.org/packages/4c/25/ 151AEB11E80F99B97D3EB93A2C98BCACD857F28C4FB8865EB0201D800E97/OPENCV_PYTHON-3.4.0.12-CP36-CP36M-WIN_AMD64.WHL ( 33.3MB)
???? 100% |████████████████████████████████| 33.4MB 581kb/s
Requirement already satisfied:numpy>=1.11.3 in C:\Program Files\python36\lib\site-packages (from Opencv_python) ( 1.14.3)
Installing collected Packages:opencv-python
Successfully installed opencv-python-3.4.0.12

???? Verify the installation:
PS c:\windows\system32> python
Python 3.6.5 (V3.6.5:F59C0932B4, Mar 2018, 17:00:18) [MSC v.1900-bit (AMD64)] on Win32
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Cv2
>>> Print (cv2.__version__)
3.4.0

???? It looks like there's an updated version here, but it's not manually downloaded and installed.

https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

??? Yes, there was an interesting error when upgrading Python itself:

C:\Personal\Hao.Hu\My Codes>jupyter
Fatal error in launcher:unable to create process using ' "" C:\Program Files\python36\python.exe "?" C:\Program Files\python36\scripts\jupyter.exe "'

??? Looked up, and the path setting causes the compiler to generate the EXE path error related. Toss a few, change the path and then reinstall the library, again compiled EXE is no problem.




Build a Python environment for beginners to learn AI/ML

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.