- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2023 08:16 AM
@Saeid Hedayati :
The error message indicates that the mlflow.spark.log_model function is attempting to save the model metadata to an untrusted filesystem called com.databricks.mlflowdbfs.MlflowdbfsFileSystem, but Spark has been configured to only allow trusted filesystems.
One potential solution to this issue is to explicitly set the filesystem type used by MLflow to a trusted filesystem like S3 or Azure Blob Storage. You can do this by setting the MLFLOW_EXPERIMENT_STORAGE environment variable to the desired filesystem type.
For example, if you are using S3 as your artifact store, you can set the MLFLOW_EXPERIMENT_STORAGE
environment variable as follows:
import os
os.environ['MLFLOW_EXPERIMENT_STORAGE'] = 's3://my-bucket/mlflow'Replace my-bucket with the name of your S3 bucket and mlflow with the desired path in the bucket.
Alternatively, you can try saving the model metadata to a local filesystem instead of a DBFS path by specifying a local path for the artifact_uri parameter of the mlflow.start_run function:
with mlflow.start_run(artifact_uri='/path/to/local/dir'):
# ...
mlflow.spark.log_model(spark_model=cvModel.bestModel, artifact_path="best_model")Replace /path/to/local/dir with the path to a local directory where you want to save the model metadata.