【问题标题】:Permission denied: '.\NTUSER.DAT' when trying to run an Azure ML Pipeline尝试运行 Azure ML 管道时权限被拒绝:“.\NTUSER.DAT”
【发布时间】:2020-04-18 09:41:58
【问题描述】:

简短的故事是,当我尝试从 jupyter 笔记本提交 azure ML 管道运行(azure ML 管道,而不是 Azure 管道)时,我得到PermissionError:[Errno 13] 权限被拒绝:'.\NTUSER.DAT'。更多详情:

相关代码:

from azureml.train.automl import AutoMLConfig
from azureml.train.automl.runtime import AutoMLStep
automl_settings = {
    "iteration_timeout_minutes": 20,
    "experiment_timeout_minutes": 30,
    "n_cross_validations": 3,
    "primary_metric": 'r2_score',
    "preprocess": True,
    "max_concurrent_iterations": 3,
    "max_cores_per_iteration": -1,
    "verbosity": logging.INFO,
    "enable_early_stopping": True,
    'time_column_name': "DateTime"
}

automl_config = AutoMLConfig(task = 'forecasting',
                             debug_log = 'automl_errors.log',
                             path = ".",
                             compute_target=compute_target,
                             run_configuration=conda_run_config,                               
                             training_data = financeforecast_dataset,
                             label_column_name = 'TotalUSD',
                             **automl_settings
                            )

automl_step = AutoMLStep(
    name='automl_module',
    automl_config=automl_config,
    allow_reuse=False)

training_pipeline = Pipeline(
    description="training_pipeline",
    workspace=ws,    
    steps=[automl_step])

training_pipeline_run = Experiment(ws, 'test').submit(training_pipeline)

training_pipeline 步骤运行了 apx 20 秒,然后我得到一个很长的跟踪,结束于:

~\AppData\Local\Continuum\anaconda2\envs\forecasting\lib\site- 
packages\azureml\pipeline\core\_module_builder.py in _hash_from_file_paths(hash_src)
    100             hasher = hashlib.md5()
    101             for f in hash_src:
--> 102                 with open(str(f), 'rb') as afile:
    103                     buf = afile.read()
    104                     hasher.update(buf)

PermissionError: [Errno 13] Permission denied: '.\\NTUSER.DAT'

根据Azure's docs on this topic,提交管道会上传您指定的“源目录”的“快照”。最初,我没有指定源目录,所以为了测试它,我添加了:

default_source_directory="testing",

作为 training_pipeline 对象的参数,但是当我尝试运行它时看到了相同的行为。不确定这是否与文档所指的源目录相同。文档还说,如果没有指定源目录,则上传“当前本地目录”。我使用 print (os.getcwd()) 来获取工作目录并授予“Everyone”对该目录的完全控制权限(在 windows 环境中工作)。

前面的所有代码都可以正常工作,如果我使用 ScriptRunConfig 并在附加的计算上运行它而不是使用管道/训练集群,我可以提交一个实验。

有什么想法吗?提前感谢任何试图提供帮助的人。附言没有“azure-machine-learning-pipelines”标签,我也无法添加,因为我没有足够的声望点。别人虽然可以! General 关于它们的信息。

【问题讨论】:

    标签: python azure azure-machine-learning-studio automl


    【解决方案1】:

    我通过在 AutoMLConfig 任务对象中设置 path 和 data_script 变量解决了这个答案,如下所示(相关代码由 --> 指示):

    automl_config = AutoMLConfig(task = 'forecasting',
                                 debug_log = 'automl_errors.log',
                                 compute_target=compute_target,
                                 run_configuration=conda_run_config,
                                 -->path = "c:\\users\\me",
                                 data_script ="script.py",<--
                                 **automl_settings
                                )
    

    设置 data_script 变量以包含完整路径(如下所示)不起作用。

    automl_config = AutoMLConfig(task = 'forecasting',
                                 debug_log = 'automl_errors.log',
                                 path = ".",
                                 -->data_script = "c:\\users\\me\\script.py"<--
                                 compute_target=compute_target,
                                 run_configuration=conda_run_config, 
                                 **automl_settings
                                )
    

    【讨论】:

      猜你喜欢
      • 2020-03-23
      • 2015-12-27
      • 2017-08-22
      • 1970-01-01
      • 2016-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      相关资源
      最近更新 更多