Chainer 类
表示要在 Chainer 试验中进行训练的估算器。
已弃用。 将 ScriptRunConfig 对象与自己定义的环境或其中一个 Azure ML Chainer 特选环境一起使用。 有关使用 ScriptRunConfig 配置试验运行的简介,请参阅配置和提交训练运行。
支持的版本:5.1.0、7.0.0
- 继承
-
azureml.train.estimator._framework_base_estimator._FrameworkBaseEstimatorChainer
构造函数
Chainer(source_directory, *, compute_target=None, vm_size=None, vm_priority=None, entry_script=None, script_params=None, node_count=1, process_count_per_node=1, distributed_backend=None, distributed_training=None, use_gpu=False, use_docker=True, custom_docker_base_image=None, custom_docker_image=None, image_registry_details=None, user_managed=False, conda_packages=None, pip_packages=None, conda_dependencies_file_path=None, pip_requirements_file_path=None, conda_dependencies_file=None, pip_requirements_file=None, environment_variables=None, environment_definition=None, inputs=None, source_directory_data_store=None, shm_size=None, resume_from=None, max_run_duration_seconds=None, framework_version=None, _enable_optimized_mode=False, _disable_validation=True, _show_lint_warnings=False, _show_package_warnings=False)
参数
- vm_priority
- str
将为训练创建的计算目标的 VM 优先级。 如果未指定,则使用“dedicated”。
支持的值:“dedicated”和“lowpriority”。
这仅在输入中指定了 vm_size param 时才会生效。
- distributed_backend
- str
分布式训练的通信后端。
已弃用。 使用 distributed_training 参数。
支持的值:'mpi'。
'mpi':MPI/Horovod
在 node_count 或 process_count_per_node> 1 时,此参数是必需的。
当 node_count == 1 且 process_count_per_node == 1 时,除非显式设置后端,否则不会使用后端。 分布式训练仅支持 AmlCompute 目标。
- distributed_training
- Mpi
用于运行分布式训练作业的参数。
若要运行具有 MPI 后端的分布式作业,请使用 Mpi 对象指定 process_count_per_node。
- use_gpu
- bool
指定要运行试验的环境是否应支持 GPU。
如果为 true,则将在环境中使用基于 GPU 的默认 Docker 映像。 如果为 false,则使用基于 CPU 的映像。 仅当未设置 custom_docker_image 参数时,才会使用默认 docker 映像(CPU 或 GPU)。 此设置仅用于启用了 Docker 的计算目标。
- custom_docker_base_image
- str
要从中生成用于训练的映像的 Docker 映像的名称。
已弃用。 使用 custom_docker_image 参数。
如果未设置,则将使用基于 CPU 的默认映像作为基础映像。
- user_managed
- bool
指定 Azure ML 是否重复使用现有的 Python 环境。 如果为 false,Azure ML 将基于 conda 依赖关系规范创建 Python 环境。
- conda_dependencies_file_path
- str
conda 依赖项 yaml 文件的相对路径。
如果已指定,Azure ML 将不安装任何框架相关的包。
已弃用。 使用 conda_dependencies_file 参数。
- pip_requirements_file_path
- str
pip 要求文本文件的相对路径。
这可以与 pip_packages 参数一起提供。
已弃用。 使用 pip_requirements_file 参数。
- environment_definition
- Environment
试验的环境定义。 它包括 PythonSection、DockerSection 和环境变量。 使用此参数可以设置不通过其他参数直接公开到估算器构造的任何环境选项。 如果指定了此参数,它将优先于其他与环境相关的参数,如 use_gpu、custom_docker_image、conda_packages 或 pip_packages。
对于无效组合,将报告错误。
- shm_size
- str
Docker 容器的共享内存块的大小。 如果未设置,则使用默认的 azureml.core.environment._DEFAULT_SHM_SIZE。 有关详细信息,请查看 Docker 运行参考。
注解
提交训练作业时,Azure ML 会在 Docker 容器内的 conda 环境中运行脚本。 Chainer 容器安装了以下依赖项。
依赖项 | Chainer 5.1.0 | Chainer 7.0.0 | —————————- | —————– | ————— | Python | 3.6.2 | 3.6.2 | CUDA(仅 GPU 映像)| 9.0 | 9.0 | cuDNN (仅 GPU 映像)| 7.6.3 | 7.6.3 | NCCL (仅 GPU 映像)| 2.4.8 | 2.4.8 | azureml-defaults | Latest | Latest | IntelMpi | 2018.3.222 | 2018.3.222 | horovod | 0.15.2 | 0.15.2 | miniconda | 4.5.11 | 4.5.11 | chainer | 5.1.0 | 7.0.0 | cupy-cuda90 (仅 GPU 映像)| 5.2.0 | 7.0.0 | git | 2.7.4 | 2.7.4 |
Docker 映像可扩展 Ubuntu 16.04。
若要安装其他依赖项,可以使用 pip_packages 或 conda_packages 参数。 或者,可以指定 pip_requirements_file 或 conda_dependencies_file 参数。
或者,可以生成自己的映像,将 custom_docker_image 参数传递给估算器构造函数。
有关 Chainer 训练中使用的 Docker 容器的详细信息,请参阅 https://github.com/Azure/AzureML-Containers。
属性
DEFAULT_VERSION
DEFAULT_VERSION = '5.1.0'
FRAMEWORK_NAME
FRAMEWORK_NAME = 'Chainer'
反馈
提交和查看相关反馈