Bahaa_Kattan:

I must replace ‘1’ with 2 because there is two outputs.
I ruled this out at first because it didn’t make any sense to me, I mean if my label was 1, 0 (binary) I must use 1 output but it didn’t work until I changed to (one_hot_encoding) [0, 1]
problem which is 2 need two output.


That’s not the error you were seeing.
As said before, after fixing the view operations I assumed you would run into a shape mismatch so you would need to adapt the in_features of the next linear layer.
In your case it seems that the in_features should be defined as 9000 in self.fc1.
For a binary classification you can use a single output unit and nn.BCEWithLogitsLoss or two output units and nn.CrossEntropyLoss.