Change this line:
x = x.view(-1, 126*126*16)

to
x = x.view(x.size(0), -1)

and rerun your code. The current view operation is failing, since x doesn’t contain a matching number of elements.
After you’ve changed the view operation, you might get a shape mismatch error in the next linear layer and should be able to fix it by changing the in_features of this layer.
PS: you can post code snippets by wrapping them into three backticks ```, which would make debugging easier.