error is in the 6 and 7
(6): Linear(in_features=4096, out_features=10, bias=True)
(7): Linear(in_features=4096, out_features=10, bias=True)

(7) expects the in_features to be 10
change the above code to:
(6): Linear(in_features=4096, out_features=10, bias=True)
(7): Linear(in_features=10, out_features=10, bias=True)

hope that helps!