A-Hackers-AI-Voice-Assistant icon indicating copy to clipboard operation
A-Hackers-AI-Voice-Assistant copied to clipboard

AttributeError: 'dict' object has no attribute 'step'

Open TinBarbie opened this issue 3 years ago • 1 comments

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.

TinBarbie avatar Mar 11 '21 04:03 TinBarbie

Hey, this should fix your error. The error is caused because the programm thinks scheduler is a directory. self.scheduler["scheduler"].step(avg_loss)

NoCodeAvaible avatar Mar 16 '21 18:03 NoCodeAvaible