'NBMasterBar' object has no attribute 'out' when training with Neptune.ai callback

When trying to use Neptune callback in pets dataset training I hit an error after first epoch ends.

Here is what I’m doing:

from fastai2.vision.all import *
from fastai2.callback.neptune import NeptuneCallback
path = untar_data(URLs.PETS)/'images'

def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
    path, get_image_files(path), valid_pct=0.2, seed=42,
    label_func=is_cat, item_tfms=Resize(224))

learn = cnn_learner(dls, resnet34, metrics=error_rate, cbs=NeptuneCallback())

At this moment the training starts, I can see progress bar output, then at the end of the epoch I see:

NoExperimentContext: Unable to find current active experiment

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py in on_iter_end(self)
    155             total_time = format_time(time.time() - self.main_bar.start_t)
    156             self.text = f'Total time: {total_time} <p>' + self.text
--> 157         self.out.update(HTML(self.text))
    159     def add_child(self, child):

AttributeError: 'NBMasterBar' object has no attribute 'out'

It seems it’s not able to find an active experiment although I see data reported to netpune.ai

1 Like

On a side note, it’s really cool to visualize how hyperparams (learning rate and momentum) evolves batch after batch. See following picture

1 Like

Did you sort out this error? I started getting the same NBMasterBar error when running learn.lr_find() today (it worked yesterday). After reading some other forum posts, I upgraded fastai2 and fastprogress (didn’t fix it), and then everything I had installed with either pip or conda, and then my whole system, and something in this list finally resolved the issue. Good luck!

The error message is misleading (which is why you always need to post the whole stack trace when reporting). The real error is NoExperimentContext: Unable to find current active experiment, the final message is just the fallback after that error happened and the Learner tried to remove the progress bar (which does not exist since training did not happen).