在本地使用docker部署图像分类cntk的训练模型 [英] To deploy the train model of image classification cntk with docker locally
问题描述
部署的整个过程:
(1)
cd C:\ Users \ Zhong \ AppData \ Local \ Temp \ azureml_runs \ classification-CNTK_1534903355816
cd部署
az登录
要登录,请使用网络浏览器打开页面https://microsoft.com/devicelogin,然后输入代码GWVHZ2PQJ进行身份验证.
[ >
{
"cloudName":"AzureCloud",
"id":"da6972b0-62c1-40b2-a9d6-089c9a33ab48",
"isDefault":true,
名称":"\ u514d \ u8d39 \ u8bd5 \ u7528",
状态":"Enabled",
"tenantId":"7ffdc7a0-965c-4f2b-965b-d93ba7600bb8",
用户":{
名称":"ZhongLiang_Chen@outlook.com",
类型":用户"
}
}
] >
(2)
docker登录
使用现有凭据进行身份验证...
登录成功
&s
(3)az ml env show
{ >
集群名称":"zhong",
群集大小":"N/A",
创建时间":"2018-08-19T11:04:12.123Z",
当前模式":本地",
位置":"southeastasia",
设置状态":成功",
资源组":"resource-group",
订阅":"da6972b0-62c1-40b2-a9d6-089c9a33ab48"
} >
&s
(4)az ml env local
现在以本地模式运行 跨度>
&s
(5)az ml服务创建实时-c. ./aml_config/conda_dependencies.yml -f deploymain.py -s deployserviceschema.json -n imgclassapi1 -v -r python -d helpers.py -d helpers_cntk.py -d实用程序_CVbasic_v2.py -d实用程序_general_v2.py -d svm.np -d lutId2Label.pickle-模型文件cntk_refined.model
&s
开始创建服务
开始创建图片
开始创建清单
上传pipRequirements文件
上传condaEnvFile文件
&s
启动模型注册
cntk_refined.model
尝试将模型注册到https://southeastasia. modelmanagement.azureml.net/api/subscriptions/da6972b0-62c1-40b2-a9d6-089c9a33ab48/resourceGroups/resource-group/accounts/azure-ml-model-management/models
尝试使用此信息注册模型
&s
成功注册的模型
Id:d52876b494604ba393b835939db6fd7c
更多信息:'az ml模型展示-m d52876b494604ba393b835939db6fd7c '
在C:\ Users \ Zhong \创建新驱动程序AppData \ Local \ Temp \ tmpr4zr_c1m.py
驱动程序已上传到http://mlcrpstgebb45341441d.blob. core.windows.net/amlbdpackages/27997b48-588b-4367-8414-7d60d4174cd6.py?se=2018-09-21T03%3A25%3A39Z&sp=r&sr=b&sv=2016-05-31&sig= dzbvbNTaZfPlKw8gfyCNKgGi1v6sclXKZfxlBxjOKM4%3D
helpers.py
已将依赖项helpers.py添加到资产.
helpers_cntk.py
已将依赖项helpers_cntk.py添加到资产中.
utilities_CVbasic_v2.py
已将依赖项Utility_CVbasic_v2.py添加到资产中.
utilities_general_v2.py
已将依存Utility_general_v2.py添加到资产中.
svm.np
已将依赖项svm.np添加到资产中.
lutId2Label.pickle
为资产添加了依赖项lutId2Label.pickle.
deploymain.py
已将依赖项deploymain.py添加到资产中.
deployserviceschema.json
已将依赖项deployserviceschema.json添加到资产中.
清单有效载荷
&s
成功创建的清单
Id:9cda1ba6-6d1e-40a8-8a3f-e176fd47071c
图片有效载荷:{'computeResourceId':'/subscriptions /da6972b0-62c1-40b2-a9d6-089c9a33ab48/resourcegroups/resource-group/providers/Microsoft.MachineLearningCompute/operationalizationClusters/zhong', 'imageType':'Docker','name':'imgclassapi1','description':'','manifestId':'9cda1ba6-6d1e-40a8-8a3f-e176fd47071c'}
操作ID:55fd11b2-4bd2-40fc-801c- 3084b69fefe8
创建图片..... .......................完成.
图片ID:9e3050e5-4c5a-4790-a6d9- c5849f85271a
更多详细信息:'az ml image show -i 9e3050e5 -4c5a-4790-a6d9-c5849f85271a'
用法信息:'az ml图像用法-i 9e3050e5 -4c5a-4790-a6d9-c5849f85271a'
[本地模式]正在运行Docker容器.
[本地模式]从mlcrpacr8fb197558338.azurecr中提取图像.io/imgclassapi1:18.这可能需要几分钟,具体取决于您的连接速度...
[本地模式]拉动中…… .........................................
容器端口:32770
[本地模式]等待容器初始化. .{
"Azure-cli-ml版本":"0.1.0b2.post2",
错误": "错误,容器初始化失败.请运行"az ml服务日志实时-i imgclassapi1"以确定原因."
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
请注意,此论坛是在The whole process of deployment:
(1)
cd C:\Users\Zhong\AppData\Local\Temp\azureml_runs\classification-CNTK_1534903355816
cd deploy
az login
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code GWVHZ2PQJ to authenticate.
[
{
"cloudName": "AzureCloud",
"id": "da6972b0-62c1-40b2-a9d6-089c9a33ab48",
"isDefault": true,
"name": "\u514d\u8d39\u8bd5\u7528",
"state": "Enabled",
"tenantId": "7ffdc7a0-965c-4f2b-965b-d93ba7600bb8",
"user": {
"name": "ZhongLiang_Chen@outlook.com",
"type": "user"
}
}
]
(2)
docker login
Authenticating with existing credentials...
Login Succeeded
(3)az ml env show
{
"Cluster Name": "zhong",
"Cluster Size": "N/A",
"Created On": "2018-08-19T11:04:12.123Z",
"Current Mode": "local",
"Location": "southeastasia",
"Provisioning State": "Succeeded",
"Resource Group": "resource-group",
"Subscription": "da6972b0-62c1-40b2-a9d6-089c9a33ab48"
}
(4)az ml env local
Now running in local mode
(5)az ml service create realtime -c ../aml_config/conda_dependencies.yml -f deploymain.py -s deployserviceschema.json -n imgclassapi1 -v -r python -d helpers.py -d helpers_cntk.py -d utilities_CVbasic_v2.py -d utilities_general_v2.py -d svm.np -d lutId2Label.pickle --model-file cntk_refined.model
Starting service create
Starting image create
Starting manifest create
Uploading pipRequirements file
Uploading condaEnvFile file
Starting model register
cntk_refined.model
Attempting to register model to https://southeastasia.modelmanagement.azureml.net/api/subscriptions/da6972b0-62c1-40b2-a9d6-089c9a33ab48/resourceGroups/resource-group/accounts/azure-ml-model-management/models
Attempting to register model with this information
Successfully registered model
Id: d52876b494604ba393b835939db6fd7c
More information: 'az ml model show -m d52876b494604ba393b835939db6fd7c'
Creating new driver at C:\Users\Zhong\AppData\Local\Temp\tmpr4zr_c1m.py
Driver uploaded to http://mlcrpstgebb45341441d.blob.core.windows.net/amlbdpackages/27997b48-588b-4367-8414-7d60d4174cd6.py?se=2018-09-21T03%3A25%3A39Z&sp=r&sr=b&sv=2016-05-31&sig=dzbvbNTaZfPlKw8gfyCNKgGi1v6sclXKZfxlBxjOKM4%3D
helpers.py
Added dependency helpers.py to assets.
helpers_cntk.py
Added dependency helpers_cntk.py to assets.
utilities_CVbasic_v2.py
Added dependency utilities_CVbasic_v2.py to assets.
utilities_general_v2.py
Added dependency utilities_general_v2.py to assets.
svm.np
Added dependency svm.np to assets.
lutId2Label.pickle
Added dependency lutId2Label.pickle to assets.
deploymain.py
Added dependency deploymain.py to assets.
deployserviceschema.json
Added dependency deployserviceschema.json to assets.
Manifest payload
Successfully created manifest
Id: 9cda1ba6-6d1e-40a8-8a3f-e176fd47071c
Image payload: {'computeResourceId': '/subscriptions/da6972b0-62c1-40b2-a9d6-089c9a33ab48/resourcegroups/resource-group/providers/Microsoft.MachineLearningCompute/operationalizationClusters/zhong', 'imageType': 'Docker', 'name': 'imgclassapi1', 'description': '', 'manifestId': '9cda1ba6-6d1e-40a8-8a3f-e176fd47071c'}
Operation Id: 55fd11b2-4bd2-40fc-801c-3084b69fefe8
Creating image............................Done.
Image ID: 9e3050e5-4c5a-4790-a6d9-c5849f85271a
More details: 'az ml image show -i 9e3050e5-4c5a-4790-a6d9-c5849f85271a'
Usage information: 'az ml image usage -i 9e3050e5-4c5a-4790-a6d9-c5849f85271a'
[Local mode] Running docker container.
[Local mode] Pulling the image from mlcrpacr8fb197558338.azurecr.io/imgclassapi1:18. This may take a few minutes, depending on your connection speed...
[Local mode] Pulling...............................................
Container port: 32770
[Local mode] Waiting for container to initialize...{
"Azure-cli-ml Version": "0.1.0b2.post2",
"Error": "Error, container failed to initialize. Please run 'az ml service logs realtime -i imgclassapi1' to determine the cause."
解决方案Note that this forum was recreated on https://social.msdn.microsoft.com/Forums/en-US/5ff623a0-2768-43e1-84e8-81657d60c985/to-deploy-the-train-model-of-image-classification-cntk-with-docker-locally?forum=MachineLearning
Please disregard / close this forum and refer to the above link going forward. Thanks.
这篇关于在本地使用docker部署图像分类cntk的训练模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!