Getting Error while running fast ai sample code for training the model

Your data is generating a dimension mismatch.

To find your error check your code with the python debugger:

You can use the python debugger pdb to step through code.
• pdb.set_trace() to set a breakpoint
• %debug magic to trace an error

Commands you need to know:
• s - step: execute and step into function
• n - next: execute current line
• c - continue: continue execution until next breakpoint
• u - up: move one level up in the stack trace
• d - down: move one level down in the stack trace
• p - print: print variable, example: “p x” prints variable x
• l - list: lists 11 lines of code around the current line

Jeremy shows in lesson 8 how to use it.
To learn how to use pdb will pay off big times in the long run.

pdb cheatsheet: Python Debugger Cheatsheet | nblock's ~

If you run into problems with code moved to the gpu run it on the cpu or use this to get more meaningful information during debugging of cuda errors (from Lernapparat - Machine Learning):

import os
os.environ[‘CUDA_LAUNCH_BLOCKING’] = “1”

Best regards
Michael

2 Likes