cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
cancel
Showing results for 
Search instead for 
Did you mean: 

Run mlflow project from a Job.

Orianh
Valued Contributor II

Hey Guys,

I'm trying to make automated process to run ML training sessions using mlflow and databricks jobs.

While developing the model on my local machine using IDE, When finished I have a template notebook that get as parameters the mlflow project path and params.

While trying to run a job that will run this mlflow project i faced some issues and hope you will be able to help me.

Inside the training code ( e.g. main entry point ), I'm using set_experiment and start run with specific names for those run / experiment.

When trying to run this code as mlflow project using run api call, When not specified exp_name / run_name in the run api call im getting an error that i can't create an experiment from a job.

On the other hand When exp_name and run_name are specified within the run api call mlflow ignore set_experiment and start_run with the run name i wanted, Do you know if there is an option to enable creation of a experiments from a job? or way to overcome the need to specify exp_name and run name inside the run call?

After some tries i saw that mlflow create an experiment before the training code actually run, this is little problematic because if i need to specify the run name and the experiment name manually this process not gonna be to much automated 😅

Code example:

import mlflow
 
# This line throw an error, screen shot is attached.
mlflow.run ( dbutils.widgets.get('Project path), parameters=params)
 
# This line ignore any set_experiment / start_run(run_name='something') specifed in the code.
 
mlflow.run ( dbutils.widgets.get('Project path), parameters=params, experiment_name=dbutils.widgets.get('experiment_name'), run_name='test')
 

error

1 REPLY 1

Kaniz
Community Manager
Community Manager

Hi @orian hindi​ ​, We haven’t heard from you since the last response, and I was checking back to see if you have a resolution yet.

If you have any solution, please share it with the community as it can be helpful to others. Otherwise, we will respond with more details and try to help.

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.