stared / livelossplot

Live training loss plot in Jupyter Notebook for Keras, PyTorch and others
https://p.migdal.pl/livelossplot
MIT License
1.29k stars 142 forks source link

LiveLossPlot: ModuleNotFoundError: No module named 'neptune' #51

Closed bobloki closed 5 years ago

bobloki commented 5 years ago

from livelossplot.keras import PlotLossesCallback callbacks_list = [PlotLossesCallback()]


ModuleNotFoundError Traceback (most recent call last)

in 4 checkpoint = ModelCheckpoint("C:\\home\\jupyter\\experiments\\models", 5 monitor='acc', verbose=1, save_best_only=True, mode='max') ----> 6 callbacks_list = [checkpoint, PlotLossesCallback()] ~\AppData\Local\conda\conda\envs\tesseract\lib\site-packages\livelossplot\keras.py in __init__(self, **kwargs) 7 def __init__(self, **kwargs): 8 keras.callbacks.Callback.__init__(self) ----> 9 _PlotLossesCallback.__init__(self, **kwargs) ~\AppData\Local\conda\conda\envs\tesseract\lib\site-packages\livelossplot\generic_keras.py in __init__(self, **kwargs) 26 class _PlotLossesCallback(): 27 def __init__(self, **kwargs): ---> 28 self.liveplot = PlotLosses(**kwargs) 29 30 def on_train_begin(self, logs={}): ~\AppData\Local\conda\conda\envs\tesseract\lib\site-packages\livelossplot\generic_plot.py in __init__(self, figsize, cell_size, dynamic_x_axis, max_cols, max_epoch, metric2title, series_fmt, validation_fmt, plot_extrema, fig_path, target) 37 self.plot_extrema = plot_extrema 38 self.target = target ---> 39 from .neptune_integration import neptune_send_plot 40 self.fig_path = fig_path 41 ~\AppData\Local\conda\conda\envs\tesseract\lib\site-packages\livelossplot\neptune_integration.py in ----> 1 import neptune 2 3 ctx = neptune.Context() 4 5 ModuleNotFoundError: No module named 'neptune'
khalido commented 5 years ago

I'm using the tf.keras version and getting the same error:

from livelossplot.tf_keras import PlotLossesCallback
plot_losses = PlotLossesCallback()
stared commented 5 years ago

@khalido @bobloki Thanks for reporting.

It should not require neptune (after #47 it required, but I fixed that with 7876f0690e1d4fe229ceecd696d314cb73d79855; as the general philosophy is to avoid ML packages).

I spotted an unintentional import, fixed with 090eb512f436be5f7b663aea2c4e373a62bdeec8. Installing from git should solve it. Version 0.3.3 (not yet released) should work.

collinp-spindance commented 5 years ago

@stared thank you for addressing this.

I have been having this same issue. I did try re-installing livelossplot from git, but unfortunately am still receiving this same error, even after re-starting jupyter. I will continue to search for the issue, but please do let me know if you come across anything else.

stared commented 5 years ago

@collinp-spindance Stange. Could you share the new error message?

collinp-spindance commented 5 years ago

@stared

# to plot live loss function
from livelossplot.keras import PlotLossesCallback

plot_losses = PlotLossesCallback()
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-13-4f4ff436e080> in <module>
      2 from livelossplot.keras import PlotLossesCallback
      3 
----> 4 plot_losses = PlotLossesCallback()

/anaconda3/lib/python3.6/site-packages/livelossplot/keras.py in __init__(self, **kwargs)
      7     def __init__(self, **kwargs):
      8         keras.callbacks.Callback.__init__(self)
----> 9         _PlotLossesCallback.__init__(self, **kwargs)

/anaconda3/lib/python3.6/site-packages/livelossplot/generic_keras.py in __init__(self, **kwargs)
     26 class _PlotLossesCallback():
     27     def __init__(self, **kwargs):
---> 28         self.liveplot = PlotLosses(**kwargs)
     29 
     30     def on_train_begin(self, logs={}):

/anaconda3/lib/python3.6/site-packages/livelossplot/generic_plot.py in __init__(self, figsize, cell_size, dynamic_x_axis, max_cols, max_epoch, metric2title, series_fmt, validation_fmt, plot_extrema, fig_path, target)
     37         self.plot_extrema = plot_extrema
     38         self.target = target
---> 39         from .neptune_integration import neptune_send_plot
     40         self.fig_path = fig_path
     41 

/anaconda3/lib/python3.6/site-packages/livelossplot/neptune_integration.py in <module>
----> 1 import neptune
      2 
      3 ctx = neptune.Context()
      4 
      5 

ModuleNotFoundError: No module named 'neptune'
stared commented 5 years ago

@collinp-spindance THen it is NOT the latest version from GitHub (though, it may be the last from PyPI). There is no such import in: https://github.com/stared/livelossplot/blob/master/livelossplot/generic_plot.py

collinp-spindance commented 5 years ago

@stared Hmm. I used pip install git+git://github.com/stared/livelossplot.git. What is the best way to get the latest version from github? Clone the repo?

sebastienlange commented 5 years ago

@stared I have the same error. Even after installing your last commit with pip install git+git://github.com/stared/livelossplot.git@090eb512f436be5f7b663aea2c4e373a62bdeec8

leofidus commented 5 years ago

Same problem, I'm using pip install git+git://github.com/stared/livelossplot.git@651f1be9c6df75a24e4cd47c3bb150da98132cdb to just get the latest commit before the neptune integration was introduced

stared commented 5 years ago

I did test it locally, and it produces no errors. Are you sure you uninstalled livelossplot before installing it from git? (Since there it is the same version, pip may not recognize that the code is different.)

Regardless, I will make an update shortly.

sebastienlange commented 5 years ago

Indeed uninstall before install the specific commit from git solves the problem

stared commented 5 years ago

Published 0.3.3 to PyPi, it should work.

collinp-spindance commented 5 years ago

@stared Re-installed from PyPi and it is working great for me now. Thank you very much!