Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting experiment on Databricks #7

Open
tahaum opened this issue Jun 11, 2021 · 2 comments
Open

Exporting experiment on Databricks #7

tahaum opened this issue Jun 11, 2021 · 2 comments

Comments

@tahaum
Copy link

tahaum commented Jun 11, 2021

Hi! I'm trying to export an experiment to a folder using Databricks. I've got it to work running the commands listed in the README locally, but when trying the same in my Databricks workspace I'm running into trouble. After building the wheel, pushing it to DBFS and installing it on the cluster I'm trying the following:

%sh

python -u -m mlflow_export_import.experiment.export_experiment \
  --experiment /Shared/my_experiment \
  --output-dir /dbfs/mnt/out \
  --notebook-formats SOURCE

I then get the following error:

Traceback (most recent call last):
File "/databricks/conda/envs/databricks-ml/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/databricks/conda/envs/databricks-ml/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/mlflow_export_import/experiment/export_experiment.py", line 82, in
main()
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/mlflow_export_import/experiment/export_experiment.py", line 78, in main
exporter = ExperimentExporter(None, export_metadata_tags, utils.string_to_list(notebook_formats))
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/mlflow_export_import/experiment/export_experiment.py", line 22, in init
self.fs = filesystem or _filesystem.get_filesystem()
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/mlflow_export_import/common/filesystem.py", line 50, in get_filesystem
return DatabricksFileSystem() if use_databricks else LocalFileSystem()
File "/databricks/conda/envs/databricks-ml/lib/python3.8/site-packages/mlflow_export_import/common/filesystem.py", line 13, in init
self.dbutils = IPython.get_ipython().user_ns["dbutils"]
AttributeError: 'NoneType' object has no attribute 'user_ns'

Is this the right approach when running export/import on Databricks?

@dharmeshpurohit
Copy link

I am also getting same issue is there any resolution to this issue?

@amesar
Copy link
Owner

amesar commented Aug 5, 2021

Try using these Databricks notebooks: https://github.com/amesar/mlflow-export-import#databricks-notebooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants