Upload Image data-set to Azure Machine Learning studio from local machine !!
*Steps with image
I was working with computer vision project. The data set was large in size(Image data set) around 2Gb. So I decided to train the model on Azure Cloud. The Azure documentation is perfect resource to setup environment for machine learning, but at a specific point you won’t find the solution for specific task. How to upload data set of size more than 95Mb? How to download model to local Machine?, etc.
In this blog, I will explain exact steps that need to follow to create environment, notebook, compute, upload data set, load it in your environment.
Pre-requisite: Azure Cloud Account.
Enter your email id and password. Then you will be redirected to Azure Portal Page.
Now click on “Create a Resource”. Type “Machine Learning” in the search box and select the first option.
Machine Learning Dashboard will pop up. Click on “Create” Button. It will ask you to fill some information.
“Workspace Name”: Name of the environment/workspace”
“Subscription”: Select the subscription.
“Resource Group”: If you have already created a resource group, use it. Or you can create new via clicking on ”Create new” button below resource group. Type the name of resource group as per your choice. (Note: It should be unique).
“Location”: Choose your location.
“Workspace Edition”: Choose anyone of available edition.
Then click on “Review and Create” button. It will review your all inputs. If all are correct, then it show check sign in each field.
Now, if all field inputs are valid, then click on “Create” button.
This will start creation of workspace and take you to the deployment page. The deployment will be in process. Wait for few seconds. Once the deployment is finished it will show the message ”Your deployment is complete”. Now click on “Go to Resource” button.
It will show your workspace overview page. From here you will be able to control your whole workspace. Click on “Launch Now”.
The new tab will open, it’s the workspace that we have created. There are various option on left side. Click on “Notebook”. We will first create a python notebook. Then click on “create new file” icon, as shown in below image.
Enter the file name, and select file type as Python Notebook and create it. You have created the notebook successfully. But we need to create a compute that is granting the RAM and Memory.
Click on new compute icon, then fill the required details. Select VM and its size as per your requirement. Then create it. It will take few seconds to create a compute. Till that we will upload our data to workspace.
On left side panel, click on “Dataset”. Then click on Create dataset icon. In this tutorial, we are focusing to load data from local machine only. So, select “From local files”.
Then name your dataset. In dataset type, select file. As we uploading the image dataset. Select Next.
Select “Previously created data store”. Then click on “browse” and select the zip file of your data-set. Then click next button. Uploading process will start. Once uploading is finished, create button will pop up. Click on it, so that dataset uploading process is completed.
Then click on your dataset name, and then in “Consume” tab, you will find the code. Copy it as it will be required to get the zip file in your notebook.
Step 5: Final step
Go back to “Notebook”. The status of computing is now converted to “Running”. Now click on edit button, and select the “Jupyter Notebook”. The notebook that we created will open in juptyer notebook.
In jupyter notebook, paste the code, that we copied from “Consume” tab. And run it. It will give you instruction to authenticate to access the data. The output of the code will provide a link and code. Go to that link and input the given code. See the highlighted part in below image.
After the authentication, the data will loaded. But now, we need to extract the zip file. In the next cell paste the below code.
import osimport zipfilelocal_zip = ‘data.zip’zip_ref = zipfile.ZipFile(local_zip, ‘r’)zip_ref.extractall(‘’)zip_ref.close()
This will extract the zip file.
Now, go back to Workspace and refresh the page, you will find the extracted data.
Finally, we have uploaded and extracted the data!!
For any Doubt or help, feel free to contact me!!
Thanks for reading.