![](/img/trans.png)
[英]Creating azure ml experiments merely using python notebook within azure ml studio
[英]Python code failed in Azure ML Experiments but runs in conda environment
我在我的 Azure ML 計算實例中創建了自定義 conda 環境,並驗證了 python 代碼在環境中運行。 但是,當我在 Azure ML 實驗中提交 .py 文件時,即使為實驗設置了相同的 conda 環境,運行也會失敗。
這就是我提交實驗的方式:
ws = Workspace.from_config()
compute_name = os.environ.get("AML_COMPUTE_CLUSTER_NAME", "mycompute_cluster")
compute_target = ws.compute_targets[compute_name]
env = Environment.from_existing_conda_environment('expEnv', "myEnv")
experiment = Experiment(workspace=ws, name='exp')
config = ScriptRunConfig(source_directory='./',
script='exp1.py',
compute_target=compute_target)
config.run_config.environment = env
run = experiment.submit(config)
aml_url = run.get_portal_url()
print(aml_url)
我還嘗試從 conda YAML 文件創建 Azure ML 環境並在提交實驗時使用它,但我仍然遇到相同的錯誤。
錯誤:
UserError:模塊'tensorflow.python.training.experimental.mixed_precision'沒有屬性'_register_wrapper_optimizer_cls'
似乎所需的模塊丟失或重命名。 您需要確保在代碼中使用具有 required 屬性的相同模塊版本。
此外,您可能需要按照@HarshithaVeeramalla-MT 在評論部分的建議,使用pip3 install tf-nightly
命令安裝模塊tf-nightly
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.