Search code examples
azureazure-machine-learning-serviceazureml-python-sdkazuremlsdk

AzureML Model Register


I was trying to register a model using the Run Class like this:

model = run.register_model(
    model_name=model_name,
    model_path=model_path)

Errors with message: Could not locate the provided model_path ... in the set of files uploaded to the run...


Solution

  • The only way I found to fix the issue was to use the Model Class instead:

            model = Model.register(
                workspace=ws,
                model_name=model_name,
                model_path=model_path,
                model_framework=Model.Framework.SCIKITLEARN,
                model_framework_version=sklearn.__version__,
                description='Model Deescription',
                tags={'Name' : 'ModelName', 'Type' : 'Production'},
                model_framework=Model.Framework.SCIKITLEARN,
                model_framework_version='1.0'
                )