在实践mlflow中,出现报错,
mlflow mlflow.exceptions.RestException: RESOURCE_DOES_NOT_EXIST: Run '9df7df0541ce4d2d846aa0d5a2811d08' not found
经过排查,发现,
创建空间等代码,需要放在with mlflow.start_run() as run
的外面。
即:
mlflow.set_tracking_uri(tracking_uri)
mlflow.autolog()
# model params
mlflow.log_params(train_params) # log_param(key: value), log_params(dict)
if not mlflow.get_experiment_by_name(experiment_name):
mlflow.create_experiment(experiment_name, artifact_location=oss_save_path)
mlflow.set_experiment(experiment_name)
# load data
X_train, X_test, y_train, y_test = load_data()
在session之外就运行,不受with影响。