so right now what i’m doing is to mimic your code like that:
model = Network()
model = model.to(memory_format=torch.channels_last)
model = model.double()
criterion = nn.BCELoss()
optimizer = optim.Adam(params = model.parameters(), lr = 0.01)

…
for epoch in range(epochs):  # loop over the dataset multiple times

    model.train()
    for j, data in enumerate(trainloader, 0):
        # Get the inputs; data is a list of [inputs, labels]
        inputs, labels = data
        print(inputs.stride())
        inputs = inputs.to(memory_format=torch.channels_last)
        print(inputs.stride())

        # Zero the parameter gradients
        optimizer.zero_grad()

        # Forward + Backward + Optimize
        outputs = model(inputs.double())
        loss = criterion(outputs, labels.double())
        loss.backward()
        optimizer.step()

        print("epoch\t{}\t\tbatch\t{}\nloss\t{}\n---".format(epoch, j, loss.item()))

and is still not working, i even tried to print out the stride before and after the channel_last operation and this is what i get:
(60, 6, 1, 1)
(60, 6, 1, 1)

Error:
RuntimeError: Given groups=1, weight of size 64 1 3 6, expected input[2048, 10, 6, 1] to have 1 channels, but got 10 channels instead