2

I have created a data science neural network in Python anaconda Spyder. My projects have multiple .py files and I have trained this model for 10 days and weights are generated. I want to use this model as a service and want to deploy it to Azure for consumption. I tried following but facing difficulties -

1) I tried deploying this as "Execute Python Script" in Azure ML studio but I am not finding an option to upload the weights. I understand I can zip all the .py files but what about the trained weights and virtual environment (I am using an old version of tensorflow)?

2) I am seeing an option of creating a Jupyter notebook but my project is created in Spyder and doesn't have .ipynb files. Is there any way to convert my .py files into .ipynb files? ALso, I have created a virtual environment with the older version of tensorflow and python version? How to take care of this while deploying to azure?

3) I tried deploying this to azure as a python web app but again what shall I do with the virtual environment and my existing weights? Also, how do I create my configuration or dependency file required for webapp?

Please, can you let me know the best method to deploy this solution to azure with weights if possible?

Thanks

Ashlou
  • 684
  • 1
  • 6
  • 21
Raj
  • 47
  • 2
  • 8

2 Answers2

0

I cannot help you much as it seems that you are not familiar with it and it is hard to express just by words.

First, have you saved your trained model? If you have saved it, you can upload the saved model and reload it after deployment.

Second, you don't need to use a jupyter notebook, that is meaningless in your situation.

Third, you don't need to create virtualenv by yourself. You just need to provide a requirements.txt file to specify all packages you need. And Azure web app will automatically create a virtualenv and install every packages in requirements.txt.

Finally, if you want to work it out, you should first start with some simple example.

Sraw
  • 18,892
  • 11
  • 54
  • 87
0

According to your description, it sounds like you want to deploy your trained tensorflow model as an Execute Python Script module on Azure ML Studio and publish it as webservice for consumption.

So if not considered for the compatiblilty of tensorflow CPU]-only code, as you said, you can refer to the offical document Execute Python machine learning scripts in Azure Machine Learning Studio and the SO thread Updating pandas to version 0.19 in Azure ML Studio to zip all files and dependencies which include .py files and your exported trained model as a read-only file to setup an Azure ML webservice like the document describes.

Or there was a similar thread How to deploy a tensorflow model to azure ml workbench to save model as a protobuf for consumption.

However, some workaround ways just using Azure GPU Machine or Docker for deployment is simple for the scenario. Please refer to these Train a TensorFlow model in the cloud and TensorFlow on Docker with Microsoft Azure Container Services.

Hope it helps.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32