An overview of the

MobileNetSv2 is based on a streamlined architecture that uses deep separable convolution to construct lightweight deep neural nets. This model is based on the implementation of the model structure proposed in MobileNetV2: Inverted Residuals and Linear Curves. You can use images to categorize tasks, such as cats and dogs, flowers, etc. The user provides a series of data sets with annotations, and the algorithm loads the pre-training model on ImageNet-1000 to do the transfer learning on the user’s data sets. The trained models can be deployed directly on the ModelArts platform as online services or batch services, with support for reasoning using the CPU, GPU, or Ascend 310. (The above introduction is from ModelArts AI Market Algorithm Introduction)

Note: ModelArts and OBS buckets are required. It is recommended to purchase resources or vouchers in advance, or to use a free specification, but OBS costs money.

Prepare the data set

The flower data set is used here, a total of 3669 flower pictures, 5 species, Data set download address http://download.tensorflow.org/example_images/flower_photos.tgz (data sets from both own bo yu blog provided data sets, thank you in here, Enclosed bosses blog links to https://bbs.huaweicloud.com/blogs/158092, the inside is described in detail, Suggestions can have a look at, learning to study, the following ways of uploading data set also comes from the blog)

After downloading and unpacking, enter the flower_photos directory, which has five subdirectories

To upload the flower_photos folder, which is the next folder to the above five files, to OBS (Huawei Cloud Object Storage Service), it is recommended to use OBS Browser to upload. OBS Browser download: https://support.huaweicloud.com/browsertg-obs/obs_03_1003.html

After uploading, go back to ModelArts home page, click “Data Management” -> “Data Set” on the left, and then click “Create Data Set”

Then select two folders in OBS in “Data Set Input Location” and “Data Set Output Location” (the folders must be empty if you want to create them by yourself), and the rest of them will be OK by default. Then click the lower right corner to create them.

Go back to the Data Management -> Data Sets screen and click on the data set you just created

Click on the DataSet to enter the DataSet interface and select Import in the upper right corner

After clicking Import, select the path from which the data set was originally uploaded, which is the folder Flowers_Photos.

After you select it, you have to wait for a while. You may see that the import is still 0. Don’t worry, wait a minute. When you see the following, the import is complete and you are ready to publish the dataset.

Again, click on the dataset, go to the screen you just imported, and select Publish in the upper right corner

An 8:2 ratio was selected to divide the training set and the test set. Click OK. Wait for the dataset creation to complete.

Now let’s start training. Here we have to go to the AI market first. The subscription algorithm, rest assured, is free. Click the link to enter the algorithm subscription https://console.huaweicloud.com/modelarts/?region=cn-north-4#/aiMarket/aiMarketModelDetail/overview?modelId=0470e6b1-923 b-47a8-ba3e-fe93de5ae2a0&type=algo

Click subscribe and follow the pop-up screen to confirm.

Once you have subscribed, you also need to configure the synchronization algorithm by clicking the Application Console

Now that you have the algorithm and the data, let’s execute the training. Select Create Training Job.

Here we just create data sets and the corresponding version number, here I was using a previously created data set, so the data set name and version number and created earlier, you would choose just created, at the same time, also create an empty folder to store training output, as for the training log, can choose not to store path.

Also choose a training spec, or if you don’t have a voucher, choose the free version

Finally, select the next step.

There may be several confirmation options that are finally available

Next, wait for the training to be completed. For a more detailed introduction to the training, you can refer to the introduction of the algorithm subscription interface and set parameters by yourself.

This training is done in about 17 minutes, which is pretty fast. Next, import the model.

The previous training job name is random, select it, should be selected after import, the automatic selection is just the training. Click Create Now in the lower right corner and wait for the import.

The display is normal, indicating success. Let’s start the online deployment.

The default is to use CPU deployment reasoning, although GPU and ASCEND are also available, as described on the algorithm page.

Take the CPU as an example. Click Deployment and select Online Deployment.

Just choose the free CPU experience spec

Select Next, Confirm, Get

Next select forecast — > upload — > forecast can be.

Finally, look at the results. Not bad.

The above is based on ModelArts AI market algorithm MobileNet_v2 to achieve flower classification practice content. Is it very simple? Come and have a try.

Click on the attention, the first time to understand Huawei cloud fresh technology ~