A-Hackers-AI-Voice-Assistant
A-Hackers-AI-Voice-Assistant copied to clipboard
AttributeError: 'dict' object has no attribute 'step'
Hi, i was running train.py in my own dataset and got the error: AttributeError: 'dict' object has no attribute 'step'. I found it's because the line code "self.scheduler.step(avg_loss)" and i changed it to "self.step(avg_loss)". But another error just happened: TypeError: iteration over a 0-d tensor in line code: "spectrograms, labels, input_lengths, label_lengths = batch". Does anyone solve this? Many thanks.
Hey,
this should fix your error. The error is caused because the programm thinks scheduler is a directory.
self.scheduler["scheduler"].step(avg_loss)