Visual Studio full AI Handbook-build MacOS Development environment starting from 0

Source: Internet
Author: User
Tags python script


Visual Studio Full AI Handbook-starting from 0 to build a MacOS development environment video Tutorials for this video please visit: https://www.bilibili.com/video/av24368929/0, prerequisites
    • A computer that can be networked, using the MacOS operating system
    • Make sure the mouse, keyboard, and monitor are all good
First, the tool introduction viusal Studio code


Visual Studio Code is another tool that Microsoft has produced after the Visual Studio Universe First IDE, a completely free text editor.



Visual Studio Code supports Windows, Linux, and Mac's three operating systems, with first-class responsiveness, whether it's its own startup, loading directories, and opening large files, all at a very fast pace, and the ability to extend the text editor is also powerful. With its active ecosystem support, a large number of plugins are available for developers to configure themselves, such as support for a variety of niche languages, data access, keyboard layouts, and so on, in addition, it is very flexible in configuration, but mostly JSON-based text configuration, not easy to understand the graphical interface, but familiar with it is very convenient.


Tools for AI


The tools for AI on Visual Studio code is Microsoft's official one-stop machine learning integrated development environment, which, combined with VS code, enables developers to develop code from editing, training, integration models, and services and applications in the same development environment.



The Tools for AI integrates the scheduling and management of training tasks very well. Now, the backend computing platform supports native, Linux servers, Microsoft's Enterprise computing resource management platform, Azure's machine learning platform, Batch AI, and more.
Also can manage various Remote storage, upload data directly in the interface, download the model log and other files.


II. Building a development environment visual Studio Code installation


Visit https://code.visualstudio.com



Click Download to automatically download visual Studio Code for the corresponding operating system





Plug-in Installation


First Open vs Code, click the Extensions icon






First, install the Python plugin.






After the plugin is automatically updated or installed, it will prompt reload, click Reload, VS code will reboot and load the appropriate plugin.



Then search for the tools for AI and select the first installation.






Click Reload here as well.



Similarly, we can also install the Chinese bag, so that the Chinese can be displayed.


Install Git


Visit https://git-scm.com/downloads



Download the applicable version of Mac


Download the Deep Learning sample Library


Open the terminal, find a folder that you want to use to store these files, enter it in the terminal


git clone https://github.com/Microsoft/samples-for-ai/


At this point git starts to clone the sample library automatically





Install Python


This step is installed python3.5 or 3.6, but it is recommended that you install python3.6, and please choose 64-bit version, otherwise many deep learning framework can not be used.



Access https://www.python.org/downloads/Select the 64-bit installation package for MacOS


Note: After the Python installation is complete, locate the Python installation file in application and run the certificates Install.commands, install common root certificates, or the Python script will have a certificate error when accessing any HTTPS Web site, which will also affect our next installation process




Installation of deep learning and machine learning software and dependencies


or the folder in the previous step, enter the installer directory, enter


python ./install.py





Wait for it to finish installing.



At this point, the environmental construction has been all over.


Third, run the sample code


Starting with this step, we're going to start really training, and if you're in contact with deep learning for the first time, then you can train your first model!



First open visual Studio Code and select File-> Open samples the total directory that opens.



We use TensorFlow and mnist as an example.


Mnist is a popular sample dataset that is a picture set of handwritten numbers of people. We can use it to train a model that allows the computer to recognize what a person's handwritten figure is.



Note: If you have more than one version of Python installed on your PC, click below the VS Code windowPython environment and the program will list all the Python environments found on this computer, and we'll switch it to the right environment.



Local commissioning and training


First, clickAI Explorerto create or modify the local environment configuration.Local-Environmentunder Right, clickAdd Configuration


Set the name and fill in the path to the Python environment selected in the previous step


Click Finish in the lower right corner to refresh the environment configuration


Note: Be sure to click Finish to refresh the configuration correctly


After configuring the local environment, you also need to add a configuration to run the job, select it here, enter it, view-> command panel AI: Edit Job Properties and then enter.



Note: If you have more than one version of Python installed on your PC, change it to and then click on it to startupCommandPythonPython3FinishEnsure that you run the program with Python3 when you perform the job

Rightconvolutional.py-click, selectAI: Submit Job


Select Local


Select the running environment you just configured



You can see a new terminal window at the bottom of the screen, and the program has started to train the model.


Remote Training


Since the MAC is not configured with Nvidia graphics card, it can only use the CPU training model, if the performance of the machine is not good, sometimes it may take a long time, this time, if the remote server, especially with dedicated computing resources, the speed will be much faster. In addition, many deep learning frameworks support parallel computing, while remote training can also access parallel resources to further improve training efficiency.


The tools for AI supports a wide range of remote training platforms, including remote machine, privately deployed Pai, and Azure batch AI, and this series of blogs will detail how to use these resources later on. The Bishop of this blog explains how to train on remote Linux.




First inAI Explorer, on theRemote Linuxright mouse button, clickAdd Configuration, and then fill in your own server information, and finally clickFinishFinish settings




Then, the same as the last choiceAI: Submit Job, but this time to choose the configuration justRemote Linux



After the job is submitted, if you want to see the operation, you need to Remote LinuxSelect a previously configured machine, right-click, selectList Jobs, you can see the list of tasks submitted on this machine



Click on the one we just submitted to list all the details of this task


You can alsoOpen Storage Explorerview the directory of the task under the remote machine by clicking on the page.



If you need to see other directories of the remote machine, right-click on the machine, selectOpen Storage Explorer, selectCustom Directory, and then enter the directory you want to access.



At this point, the Remote Model Training section is finished.



Visual Studio full AI Handbook-build MacOS Development environment starting from 0

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.