Lompati ke konten utama Browser ini sudah tidak didukung. Mutakhirkan ke Microsoft Edge untuk memanfaatkan fitur, pembaruan keamanan, dan dukungan teknis terkini. PythonScriptStep Class
Creates an Azure ML Pipeline step that runs Python script. For an example of using PythonScriptStep, see the notebook https://aka.ms/pl-get-started. In this articleInheritanceazureml.pipeline.core._python_script_step_base._PythonScriptStepBase Constructor
Parametersscript_name str [Required] The name of a Python script relative to name str The name of the step. If unspecified, arguments list Command line arguments for the Python script file. The arguments will be passed to compute via the compute_target Union[<xref:azureml.core.compute.DsvmCompute,azureml.core.compute.AmlCompute,azureml.core.compute.RemoteCompute,azureml.core.compute.HDInsightCompute,str,tuple>] [Required] The compute target to use. If unspecified, the target from the runconfig will be used. This parameter may be specified as a compute target object or the string name of a compute target on the workspace. Optionally if the compute target is not available at pipeline creation time, you may specify a tuple of ('compute target name', 'compute target type') to avoid fetching the compute target object (AmlCompute type is 'AmlCompute' and RemoteCompute type is 'VirtualMachine'). runconfig RunConfiguration The optional RunConfiguration to use. A RunConfiguration can be used to specify additional requirements for the run, such as conda dependencies and a docker image. If unspecified, a default runconfig will be created. runconfig_pipeline_params dict[str, PipelineParameter] Overrides of runconfig properties at runtime using key-value pairs each with name of the runconfig property and PipelineParameter for that property. Supported values: 'NodeCount', 'MpiProcessCountPerNode', 'TensorflowWorkerCount', 'TensorflowParameterServerCount' inputs list[Union[<xref:azureml.pipeline.core.graph.InputPortBinding,azureml.data.data_reference.DataReference,azureml.pipeline.core.PortDataReference,azureml.pipeline.core.builder.PipelineData,azureml.pipeline.core.pipeline_output_dataset.PipelineOutputFileDataset,azureml.pipeline.core.pipeline_output_dataset.PipelineOutputTabularDataset,azureml.data.dataset_consumption_config.DatasetConsumptionConfig>]] A list of input port bindings. outputs list[Union[<xref:azureml.pipeline.core.builder.PipelineData,azureml.data.output_dataset_config.OutputDatasetConfig,azureml.pipeline.core.pipeline_output_dataset.PipelineOutputFileDataset,azureml.pipeline.core.pipeline_output_dataset.PipelineOutputTabularDataset,azureml.pipeline.core.graph.OutputPortBinding>]] A list of output port bindings. params dict A dictionary of name-value pairs registered as environment variables with "AML_PARAMETER_". source_directory str A folder that contains Python script, conda env, and other resources used in the step. allow_reuse bool Indicates whether the step should reuse previous results when re-run with the same settings. Reuse is enabled by default. If the step contents (scripts/dependencies) as well as inputs and parameters remain unchanged, the output from the previous run of this step is reused. When reusing the step, instead of submitting the job to compute, the results from the previous run are immediately made available to any subsequent steps. If you use Azure Machine Learning datasets as inputs, reuse is determined by whether the dataset's definition has changed, not by whether the underlying data has changed. version str An optional version tag to denote a change in functionality for the step. hash_paths list DEPRECATED: no longer needed. A list of paths to hash when checking for changes to the step contents. If there are no changes detected, the pipeline will reuse the step contents from a previous run. By default, the contents of RemarksA PythonScriptStep is a basic, built-in step to run a Python Script on a compute target. It takes a script name and other optional parameters like arguments for the script, compute target, inputs and outputs. If no compute target is specified, the default compute target for the workspace is used. You can also use a RunConfiguration to specify requirements for the PythonScriptStep, such as conda dependencies and docker image. The best practice for working with PythonScriptStep is to use a separate folder for scripts and any dependent files associated with the step, and specify that folder with the The following code example shows using a PythonScriptStep in a machine learning training scenario. For more details on this example, see https://aka.ms/pl-first-pipeline.
PythonScriptSteps support a number of input and output types. These include DatasetConsumptionConfig for inputs and OutputDatasetConfig, PipelineOutputAbstractDataset, and PipelineData for inputs and outputs. Below is an example of using Dataset as a step input and output:
Please reference the corresponding documentation pages for examples of using other input/output types. Methods
create_nodeCreate a node for PythonScriptStep and add it to the specified graph. This method is not intended to be used directly. When a pipeline is instantiated with this step, Azure ML automatically passes the parameters required through this method so that step can be added to a pipeline graph that represents the workflow.
Parametersgraph Graph The graph object to add the node to. default_datastore Union[<xref:azureml.data.azure_storage_datastore.AbstractAzureStorageDatastore,azureml.data.azure_data_lake_datastore.AzureDataLakeDatastore>] The default datastore. context <xref:azureml.pipeline.core._GraphContext> The graph context. ReturnsThe created node. Return typeSaran dan KomentarKirim dan lihat umpan balik untuk |