Can't resume interrupted training, throws AttributeError

I’m on colab and I’m trying to resume training that was running on fit_one_cycle using fastaiv1 but got interrupted, I used SaveModelCallback, so I passed start_epoch=3 to resume training but it throws

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

I even upgraded to the latest git versions of fastprogress and fastai and the problem presists.

Will work on this bug today, it’s probably linked to some changes in the last version of fastprogress.

1 Like

Should be fixed now.

Thanks! it works now.

1 Like

I’m getting the same error, running in a Google Colab. Can you share the steps you took to update your setup to get past this?

Thank you!

!pip install fastprogress --upgrade should do the trick in a colab cell

1 Like

Thank you for such a quick reply @muellerzr!
Unfortunately, it doesn’t seem to update with that command, as it says:

Requirement already up-to-date: fastprogress in /usr/local/lib/python3.6/dist-packages (0.2.2)

And then the problem persists:

/usr/local/lib/python3.6/dist-packages/fastai/ in on_train_begin(self, epochs, pbar, metrics)
265         self('train_begin', metrics_names=names)
266         if self.state_dict['epoch'] != 0:
--> 267             self.state_dict['pbar'] -= self.state_dict['epoch']
268             for cb in self.callbacks: cb.jump_to_epoch(self.state_dict['epoch'])

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

Any other thoughts?

Install directly from git source

pip install git+ --upgrade

pip install git+ --upgrade

@vijayabhaskar! That did it!
Your command successfully dowloaded the version 0.2.3.
After restarting the runtime, the error has gone away.
Thanks @sgugger, also!

1 Like

Is it safe to execute those command from a Google cloud VM terminal as well ?
I have to same problem :

AttributeError: ‘NBMasterBar’ object has no attribute ‘first_bar’

I think it should be alright, it just installs the github version through pip. It may have bugs as the code is constantly changing, but should be safe.

1 Like

there is no more first_bar, it’s main_bar now.

I’m not sure whether @sgugger wants to provide an alias for backward compatibility.

1 Like

If you have trouble installing directly from git source, you can try installing by specifying the version number.

!pip install fastprogress==0.2.3
!pip install fastai==1.0.61