'score' undefined in lesson4-mnist_sgd

Does anyone have the manual training loop at the end of the ML Lesson 4 - MNIST working? I would like to explore the code but doing len on the generators isn’t working.

I did fix a few errors like TypeError: object of type 'generator' has no len() by changing len(foo) to len(list(foo)).

I don’t think this is the right way so this might just be a simple python question.

2 Likes

Think there are a few slight typos in the notebooks. I changed the line

for t in range(len(dl)):
to
for t in range(len(md.trn_dl)):

and it worked all fine. Similarly for the validation line at the bottom.

6 Likes