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

assert df.shape[0] != 0, 'No experiments to show. Try other filters.' #123

Closed
ali3assi opened this issue Feb 10, 2021 · 10 comments
Closed

Comments

@ali3assi
Copy link

ali3assi commented Feb 10, 2021

Im trying to use hiplot with neptune.
I get the following exception:

Traceback (most recent call last):
  File "c:/Users/ali/Desktop/pythonProjects/Deep-learning-algo-master/src/TestDriver.py", line 204, in <module>
    make_parallel_coordinates_plot(html_file_path='my_visual.html',
  File "C:\Users\ali\miniconda3\envs\iptoki\lib\site-packages\neptunecontrib\viz\parallel_coordinates_plot.py", line 141, in make_parallel_coordinates_plot
    assert df.shape[0] != 0, 'No experiments to show. Try other filters.'
AssertionError: No experiments to show. Try other filters.

in my code: I call the make_parallel_coordinates_plot after the optimization step. So in Neptune, I can see for example, in my workspace, the number of the experiment let say ali-22.
I tried to give the experiment id explicitly by setting the experiment_id = 'ali-22' in make_parallel_coordinates_plot but the same exception is thrown.
Any suggestion to solve this is so appreciated.

@jakubczakon
Copy link
Contributor

Hi there @ali3assi

Looking at the example in the docs.

import neptune

from neptunecontrib.viz.parallel_coordinates_plot import make_parallel_coordinates_plot

neptune.init('USERNAME/example-project')

make_parallel_coordinates_plot(html_file_path='my_visual.html',
                               metrics= ['epoch_accuracy', 'epoch_loss', 'eval_accuracy', 'eval_loss'],
                               params = ['activation', 'batch_size', 'dense_units', 'dropout', 'learning_rate', 'optimizer'],
                               tag='optuna')

And the error you are getting I think the reason could e the fact that you have a tag=SOMETHING where you have no experiments that are tagged 'SOMETHING' in your project. Perhaps dropping the tag argument could help?

@ali3assi
Copy link
Author

Thanks a lot for your help @jakubczakon. I will test it when my training finish. But you have reason, in my experiment ali-22 I don't tag my experiment. SO almost you have reason.
When I get the result of my test, i will update this issue.

@ali3assi
Copy link
Author

ali3assi commented Feb 10, 2021

Hi @jakubczakon

I set params to true. and i get the following:
make_parallel_coordinates_plot(html_file_path='my_visual.html',

  File "C:\Users\ali\miniconda3\envs\iptoki\lib\site-packages\neptunecontrib\viz\parallel_coordinates_plot.py", line 236, in make_parallel_coordinates_plot
    return hiplot_vis.display()
  File "C:\Users\ali\miniconda3\envs\iptoki\lib\site-packages\hiplot\experiment.py", line 247, in display
    raise RuntimeError(r"""`display` can only be called on an ipython context. Are you in a notebook?
RuntimeError: `display` can only be called on an ipython context. Are you in a notebook?
- To render an experiment to HTML, use `experiment.to_html(file_name)` or `html_page = experiment.to_html()`
- To render an experiment in Streamlit, use `experiment.display_st`

I am not on netbook. I just want to save the generated image in an html and saved in Neptune in my project. In other words can I saved the picture in the artifacts tab.

@jakubczakon
Copy link
Contributor

Looking at the code, it seems that even when it is saved it tries to plot it (and fails outside of notebooks).
There should be a flag for plot_in_notebook or something.
I think it actually saves this in HTML (but then fails).

Could you just wrap it in try catch and I'll add a flag later today or tomorrow?

try:
   make_parallel_coordinates_plot(...)
except Exception:
    pass
neptune.log_artifact('my_visual.html')

@jakubczakon
Copy link
Contributor

jakubczakon commented Feb 10, 2021

Alternatively, which could be even better is to do it in the notebook and then log the notebook checkpoint to Neptune -> it will be interactive as well.

Just like this one:
https://ui.neptune.ai/o/USERNAME/org/example-project/n/parallel-plot-cb5394cc-edce-41e3-9a25-7970865c66ad/59377976-6651-40ed-b3c3-eb0fa5aa79bc

You can read more about notebook tracking here https://docs.neptune.ai/keep-track-of-jupyter-notebooks/index.html

@ali3assi
Copy link
Author

try:
   make_parallel_coordinates_plot(...)
except Exception:
    pass
neptune.log_artifact('my_visual.html')

with this one i get:

Traceback (most recent call last):
  File "c:/Users/ali/Desktop/pythonProjects/Deep-learning-algo-master/src/TestDriver.py", line 217, in <module>
    neptune.log_artifact('my_visual.html')
  File "C:\Users\ali\miniconda3\envs\iptoki\lib\site-packages\neptune\__init__.py", line 371, in log_artifact
    return get_experiment().log_artifact(artifact, destination)
  File "C:\Users\ali\miniconda3\envs\iptoki\lib\site-packages\neptune\__init__.py", line 257, in get_experiment
    return project._get_current_experiment()
  File "C:\Users\ali\miniconda3\envs\iptoki\lib\site-packages\neptune\projects.py", line 612, in _get_current_experiment
    raise NeptuneNoExperimentContextException()
neptune.exceptions.NeptuneNoExperimentContextException:

----NeptuneNoExperimentContextException---------------------------------------------------------------------------------

Neptune couldn't find an active experiment.

Looks like you forgot to run:
    neptune.create_experiment()

You may also want to check the following docs pages:
    - https://docs.neptune.ai/getting-started/quick-starts/log_first_experiment.html

Need help?-> https://docs.neptune.ai/getting-started/getting-help.html

@jakubczakon
Copy link
Contributor

You need to create an experiment first (before creating the plot) so that you can log this chart to an experiment

so

import neptune

neptune.init() # your credentials
neptune.create_experiment('experiment comparison')

try:
   make_parallel_coordinates_plot(...)
except Exception:
    pass
neptune.log_artifact('my_visual.html')

@ali3assi
Copy link
Author

ali3assi commented Feb 10, 2021

You need to create an experiment first (before creating the plot) so that you can log this chart to an experiment

so

import neptune

neptune.init() # your credentials
neptune.create_experiment('experiment comparison')

try:
   make_parallel_coordinates_plot(...)
except Exception:
    pass
neptune.log_artifact('my_visual.html')

It works but it create my_visual.html which is empty (i.e. i have a new line in the dashbord called ali-23). It is empty because i dont make the traning. So i think we are so close. Just we need to attach a given existing experiment lile ali-22 to my_visual.html.

@jakubczakon
Copy link
Contributor

parallel coordinates plot doesn't make much sense for one experiment though -> you should have a bunch of experiments you want to compare first.

I think we should try to :

  • query exp list or leaderboard project.get_leaderboard(tag=...)
  • plot it in notebook via make_parallel_coordinates_plot(...)
  • wrap it in try catch and log via neptune.log_artifact(...)

@ali3assi
Copy link
Author

@jakubczakon may be you have reason. I am looking to draw the curves for the different hyperparameters trials in one experiments.

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