Target and output shape/type for binary classification using PyTorch so I have some annotated images that I want to use to train a binary image classifier but I have been having issues creating the dataset and actually getting a test model to train. Each image is either of a certain class or not so I want to set up a binary classification dataset/model using PyTorch. I had some questions:

should labels be float or long?

what shape should my labels be?

I am using a resnet18 class from torchvision model, should my final softmax layer have one or two outputs?

what shapes should my target be, during training, if my batch size is 200?

what shape should my outputs be?


Thanks in advance
Quote Delete
According to your questions:

Labels should be long and advised.
[num_samples, ]
It should have two outputs.
If your batch_size=200 then target somehow similar to this: [0, 1, 0, 1, 1, 0, ....1]
3rd ^