pytorch-autocomplete
pytorch-autocomplete copied to clipboard
UnboundLocalError: local variable 'loss' referenced before assignment
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
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.