This error is most likely raised in the linear layer.
Flatten the activation via nn.Flatten() after the last conv layer:
    nn.Conv2d(256, 256, kernel_size=3, padding=1), nn.ReLU(),
    nn.Linear(256, 3))

and make sure the in_features of nn.Linear match the activation features.