Solved by enterthevoidf22 in post #6 
              
              
                ok thanks to Caruso i managed to figure out the problem! 
it turns out i was missing a dot when i defined the models second bias. 
in the three_layer_convnet function there’s a line: 
conv2_bias = nn.Parameter(conv_b2) 
changed it to 
conv2.bias = nn.Parameter(conv_b2) 
now it works. 
good luck to a…