pytorch-autocomplete icon indicating copy to clipboard operation
pytorch-autocomplete copied to clipboard

UnboundLocalError: local variable 'loss' referenced before assignment

Open Imenbaa opened this issue 5 years ago • 1 comments

Hi,

When I run the train function I get this error. File "C:\Desktop\work\sanstitre1.py", line 256, in train train_history['loss'].append(loss.item())

UnboundLocalError: local variable 'loss' referenced before assignment Any help??

Imen BA

Imenbaa avatar Jul 14 '20 15:07 Imenbaa

For anyone that runs into this in the future,

This seems to happen if the data is not scraped correctly.

You can just upload the dataset provided. All instructions are in the notebook - if you read along you should be able to figure it out. Though I have to say error handling could be better, this error message is indeed confusing.

rMazeiks avatar Dec 07 '20 15:12 rMazeiks