
Explanation:
ボックス 1: azureml.core.webservice から Webservice をインポート
次のコードは、SDK を使用して、Web サービスのモデル、環境、およびエントリ スクリプトを Azure Container Instances に更新する方法を示しています。
azureml.core インポート環境から
azureml.core.webservice から Webservice をインポート
azureml.core.model インポート モデル、InferenceConfig から
ボックス 2: 予測 = service.run(input_json)
例: 次のコードは、サービスへのデータの送信を示しています。
jsonをインポート
test_sample = json.dumps({'データ': [
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
[10、9、8、7、6、5、4、3、2、1]
]})
test_sample = バイト(test_sample, encoding='utf8')
予測 = service.run(input_data=test_sample)
印刷(予測)
参照:
https://docs.microsoft.com/bs-latn-ba/azure/machine-learning/how-to-deploy-azure-container-instance
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-troubleshoot-deployment