The model and training code look alright and your model is able to learn some random inputs:
if __name__=="__main__":
    x=torch.ones(1,3,256,512)
    net=Unet(3,1)
    print(net(x).shape)

    net.cuda()
    optimizer = torch.optim.Adam(net.parameters(), lr=1e-3)

    data = torch.randn(10, 3, 256, 512, device='cuda')
    target = torch.randint(0, 2, (10, 1, 256, 512)).float().cuda()
    criterion = nn.BCEWithLogitsLoss()

    for epoch in range(100):
        optimizer.zero_grad()
        output = net(data)
        loss = criterion(output, target)
        loss.backward()
        optimizer.step()
        print('epoch {}, loss {}'.format(epoch, loss.item()))

What issues are you seeing and could you check your target range in case you are seeing an increasing loss?