I encountered the same issue. Inside the method that plots the learning rate, there is a piece that doesn’t work reliably inside a jupyter notebook. I think there is a merge request on github with a discussion on this.
Not sure what the status is and can’t check right now nor can’t look this up for you in code. The way I fixed this was by commenting out an if condition. If you installed fastai using pip this might be a bit more challenging but if you are just requiring the library that sits locally in a directory on your hard drive, then you can fix this by searching for wherever plot_lr is defined and messing with the if condition.
Ok, did a quick search:
def plot_lr(self):
if not in_ipynb():
plt.switch_backend('agg')
plt.xlabel("iterations")
plt.ylabel("learning rate")
plt.plot(self.iterations, self.lrs)
if not in_ipynb():
plt.savefig(os.path.join(self.save_path, 'lr_plot.png'))
This is whats in sgdr.py
Probably something like this should work (just remove the lines):
def plot_lr(self):
plt.xlabel("iterations")
plt.ylabel("learning rate")
plt.plot(self.iterations, self.lrs)
I am quite sure this will be fixed soon so maybe look up the discussion or github or just give it a couple of days Such things are to be expected when you are on the cutting edge