thanks, so this is code:
class Net(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1=nn.Conv2d(3,32,5)
        self.conv2=nn.Conv2d(32,64,5)
        self.conv3=nn.Conv2d(64,128,5)
        self.fc1=nn.Linear(128*38*38,100)
        self.fc2=nn.Linear(100,2)
    def forward(self, x):
      x=F.relu(self.conv1(x))
      x=F.relu(self.conv2(x))
      x=F.relu(self.conv3(x))
      x=x.view(-1,128*38*38)
      x=F.relu(self.fc1(x))
      x=self.fc2(x)
      return torch.sigmoid(x)  

this is my training:
BATCH_SIZE =1
EPOCHS = 5
optimizer = optim.Adam(net.parameters(), lr=0.001)
criterion=nn.CrossEntropyLoss()
for epoch in range(EPOCHS):
    for i in tqdm(range(0, len(train_X), BATCH_SIZE)): 
        batch_X = train_X[i:i+BATCH_SIZE].permute(dims=(0,3, 1, 2))
        batch_y = train_y[i:i+BATCH_SIZE]
        batch_y=[x[0] for x in batch_y]
        batch_y=(torch.Tensor(batch_y).type(torch.LongTensor)).to(device)
        net.zero_grad()
        outputs = net(batch_X)
        loss = criterion(outputs, batch_y)
        loss.backward()
        optimizer.step()

additional information.above X,Y is:
X = torch.Tensor([i[0] for i in train_data])

X = X/255.0

y = torch.Tensor([i[1] for i in train_data])

X=X.to(device)

y=y.to(device)