我在使用自定义 docker 映像部署模型时遇到问题。部署失败,因为所需的包不在“默认”环境中,我需要指定一个自定义的。("/miniconda/envs/py37/bin/python")
I am using the same image to run the training, and with the estimator class I do have a way to specify the environment. Is it possible to something similar with the InferenceConfig?
est = Estimator(source_directory=script_folder,
script_params=script_params,
inputs=inputs,
compute_target=gpu_compute_target,
entry_script='train.py',
image_registry_details = my_registry,
custom_docker_image='omr:latest',
use_gpu=True,
user_managed=True)
est.run_config.environment.python.user_managed_dependencies = True
est.run_config.environment.python.interpreter_path = "/miniconda/envs/py37/bin/python"
#establish container configuration using custom base image
privateRegistry = aml_utils.getContainerRegistryDetails()
inference_config = InferenceConfig(source_directory="./detect",
runtime= "python",
entry_script="aml_score.py",
enable_gpu=False,
base_image="amlworkspaceom3760145996.azurecr.io/omr:latest",
base_image_registry = privateRegistry)
#deploy model via AKS deployment target
deployment_config = AksWebservice.deploy_configuration(gpu_cores = 1, memory_gb = 1, auth_enabled = False)
targetcluster = aml_utils.getGpuDeploymentTarget(ws)
model_service = Model.deploy(workspace = ws,
name = "model_name,
models = [model],
inference_config = inference_config,
deployment_config = deployment_config,
deployment_target = targetcluster)