NameError: name 'ruamel' is not defined for conda_dependencies.py

Daenerys Xiao 1 Reputation point
2021-03-27T08:49:57.98+00:00

When I use az ml to deploy my model, I get into trouble with this code:

-

  • my code is:

from azureml.core.model import Model
model = ws.models['churn-model-test']
service = Model.deploy(workspace=ws, name = 'churn-test-service', models = [model], inference_config = classifier_inference_config, deployment_config = classifier_deploy_config, deployment_target = production_cluster)
service.wait_for_deployment(show_output = True)
**

  • The Error is:

**
NameError Traceback (most recent call last) <ipython-input-56-cc3952c5e744> in <module> 7 inference_config = classifier_inference_config, 8 deployment_config = classifier_deploy_config, ----> 9 deployment_target = production_cluster) 10 service.wait_for_deployment(show_output = True) ~\anaconda3\lib\site-packages\azureml\core\model.py in deploy(workspace, name, models, inference_config, deployment_config, deployment_target, overwrite, show_output) 1660 # Environment-based webservice. 1661 if not deployment_config or deployment_config._webservice_type._webservice_type != IOT_WEBSERVICE_TYPE: -> 1662 inference_config, use_env_path = convert_parts_to_environment(name, inference_config) 1663 else: 1664 use_env_path = inference_config.environment is not None ~\anaconda3\lib\site-packages\azureml_model_management_util.py in convert_parts_to_environment(service_name, inference_config) 1220 else: 1221 conda_path = inference_config.conda_file -> 1222 env = Environment.from_conda_specification(env_name, conda_path) 1223 else: 1224 env = Environment(env_name) ~\anaconda3\lib\site-packages\azureml\core\environment.py in from_conda_specification(name, file_path) 1084 :rtype: azureml.core.environment.Environment 1085 """ # noqa: E501 -> 1086 conda_dependencies = CondaDependencies(conda_dependencies_file_path=file_path) 1087 if not conda_dependencies._python_version: 1088 module_logger.warning('No Python version provided, defaulting to "{}"'.format(PYTHON_DEFAULT_VERSION)) ~\anaconda3\lib\site-packages\azureml\core\conda_dependencies.py in init(self, conda_dependencies_file_path, _underlying_structure) 121 def init(self, conda_dependencies_file_path=None, _underlying_structure=None): 122 """Initialize a new object to manage dependencies.""" --> 123 if conda_dependencies_file_path: 124 with open(conda_dependencies_file_path, "r") as input: 125 self._conda_dependencies = ruamel.yaml.round_trip_load(input) NameError: name 'ruamel' is not defined

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,916 questions
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,376 Reputation points Microsoft Employee
    2021-03-30T03:11:39.663+00:00

    Hello @Daenerys Xiao ,
    Thanks for the ask and using the Microsoft Q&A platform .

    please upgrade to the latest version of the Azure ML SDK ands it should get fixed .

    Please do let me know how it goes .
    Thanks
    Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    0 comments No comments