Rainbow Engine

IT技術を分かりやすく簡潔にまとめることによる学習の効率化、また日常の気付きを記録に残すことを目指します。

IT技術 (Technology)

Azure Machine Learningでエラー「Experiment name must be 1-256 characters」が発生した際の原因と対処方法について

投稿日:2023年4月22日 更新日:

 

<目次>

(1) Azure Machine Learningでエラー「Experiment name must be 1-256 characters」が発生した際の原因と対処方法について
 (1-1) エラー
 (1-2) 原因
 (1-3) 対策
 (1-4) 補足

(1) Azure Machine Learningでエラー「Experiment name must be 1-256 characters」が発生した際の原因と対処方法について

(1-1) エラー

Azure Machine LearningのNotebookでcreate_or_update()メソッドを実行した際に、下記のエラーが発生しました。

(図211)

(エラーメッセージ)

HttpResponseError: (ValidationError) Experiment name must be 1-256 characters, start with a letter or a number, and can only contain letters, numbers, underscores, and dashes. Code: ValidationError Message: Experiment name must be 1-256 characters, start with a letter or a number, and can only contain letters, numbers, underscores, and dashes. Exception Details: (Invalid) Experiment name must be 1-256 characters, start with a letter or a number, and can only contain letters, numbers, underscores, and dashes. Code: Invalid Message: Experiment name must be 1-256 characters, start with a letter or a number, and can only contain letters, numbers, underscores, and dashes. Target: ExperimentName Additional Information:Type: ComponentName Info: { "value": "managementfrontend" }Type: Correlation Info: { "value": { "operation": "70a275cddfbebe92415648b565958b46", "request": "6be2fea90ce11489" } }Type: Environment Info: { "value": "japaneast" }Type: Location Info: { "value": "japaneast" }Type: Time Info: { "value": "2022-12-29T13:48:24.4921495+00:00" }

目次にもどる

(1-2) 原因

まず「returned_sweep_job = ml_client.create_or_update(sweep_job)」の行でエラーになっています
(図221)
この行を実行する前に、冒頭のエラーメッセージの通り「Experiment name」(属性名:experiment_name)を指定していないため、エラーが起こっています。

目次にもどる

(1-3) 対策

sweep_jobをcreate_or_updateする前に「Experiment name」(属性名:experiment_name)と、「Display name」(属性名:display_name)を指定する。

●Before

returned_sweep_job = ml_client.create_or_update(sweep_job)
# stream the output and wait until the job is finished
ml_client.jobs.stream(returned_sweep_job.name)
# refresh the latest status of the job after streaming
returned_sweep_job = ml_client.jobs.get(name=returned_sweep_job.name)

●After

# Specify your experiment details
sweep_job.display_name = "keras-classify-mnist-digit-images-with-dnn-sweep"
sweep_job.experiment_name = "keras-dnn-image-classify-sweep"
returned_sweep_job = ml_client.create_or_update(sweep_job)
# stream the output and wait until the job is finished
ml_client.jobs.stream(returned_sweep_job.name)
# refresh the latest status of the job after streaming
returned_sweep_job = ml_client.jobs.get(name=returned_sweep_job.name)

(図231)

(参考)
https://learn.microsoft.com/en-us/azure/machine-learning/migrate-to-v2-execution-hyperdrive

●修正後のチェック

上記の修正を適用後に再度Notebookを実行すると、sweepジョブが正しく生成されて、処理が完了した事が確認できました。

(図232)

目次にもどる

(1-4) 補足

エラーが発生した周辺のメソッドについて調査した内容を備忘で残す。

●commandメソッド

・「azure.ai.ml」パッケージのcommandメソッドを使用している。
・Commandクラスのインスタンスが生成される


使用例
(図242①)


該当ドキュメント
(図242②)


結果として、Commandクラスのインスタンスが生成される??
→このクラスにsweepメソッドがある
(図242③)

(参考)
https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml?view=azure-python#azure-ai-ml-command
https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.entities.command?view=azure-python#azure-ai-ml-entities-command-sweep

●jobメソッド

・commandメソッドから生成したCommandクラスのインスタンスについて、一部のパラメータを調整
→モデルのチューニング作業に該当。

使用例
(図242④)

該当ドキュメント
(図242⑤)

(参考)

●sweepメソッド

・Commandクラスのインスタンスでsweepメソッドを使用。
・Sweepクラスのインスタンスが生成される
使用例
(図243②)

該当ドキュメント
(図243①)

結果として、Sweepクラスのインスタンスが生成される。これをcreate_or_updateの引数にして、sweepジョブを実行している。
(参考)

https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.entities.command?view=azure-python#azure-ai-ml-entities-command-sweep

●create_or_updateメソッド

・「MLClient」クラスのcreate_or_updateメソッド。
・今回はSweepクラスのインスタンスを引数として与えて、モデルのチューニングを実施した。

(図241)

Adsense審査用広告コード


Adsense審査用広告コード


-IT技術 (Technology)
-

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

関連記事

Postmanの使い方を初めての方向けにご紹介

  <目次> (1) Postmanの使い方を初めての方向けにご紹介  (1-1) Postmanとは?  (1-2) PostmanのConnection画面(≒APIテスト機能)の見かた …

USBブートのやり方(Windows 10)と起動しない時の確認項目について

  <目次> (1) USBブートのやり方(Windows 10)と起動しない時の確認項目について  (1-1) USBブートとは?  (1-2) USBブートのやり方(手順)  (1-3) …

C#でテキストファイルを読み込む方法(サンプルプログラム付き)

  <目次> (1) C#でテキストファイルを読み込む方法(サンプルプログラム付き)  (1-1) 構文  (1-2) 事前準備  (1-3) サンプルプログラム  (1-4) ご参考:使用 …

SlackとBacklogの連携手順(まずは疎通としてBacklogのステータス更新でSlack通知する)

  <目次> (1) SlackとBacklogの連携手順(まずは疎通としてBacklogのステータス更新でSlack通知する)  (1-1) SlackとBacklogの連携概要  (1- …

Slackで自動返信の投稿をするボットをPythonで作る手順(ngrokでローカルPCをサーバーに見立てて)

  <目次> (1) Slackで自動返信の投稿をするボットをPythonで作る手順(ngrokでローカルPCをサーバーに見立てて)  (1-1) STEP1:Slackアプリの新規作成&権 …

  • English (United States)
  • 日本語
Top