Let me explain what did you wrong in 2 steps,

X = x.view(-1, 512)
X = self.fc1(X)

X from the above has a size of (batch_size, 256) as you define the output size of self.fc1 256.
Next,

X = self.fc1_bn(X)

The input X is a 2-dimensional tensor but fc1_bn is defined as 3-D batch normalization layer.
If you really want to use 3-D BatchNorm, then you should reform X before the normalization e.g.

X = X.view(1, -1, 1, 1, 256)
X = self.fc1_bn(X)

I recommend you not use batch normalization after nn.Linear. It means nothing with 2-dimensional tensor.
Just an activation is enough such as ReLU, Sigmoid, and so on.
Which activation function is the best? It’s totally up to your task.