hi Ptrblck,
I am using the following cuda lines in the main body:
 device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0) else "cpu")
class Gen_model_3D(nn.Module):
    def __init__(self, lat_dim=100):
        super(Gen_model_3D, self).__init__()
        self.D3_Encoder = D3_Encoder(lat_dim)
        self.D3_Decoder = D3_Decoder(lat_dim)
        self.cuda()
        self.lat_dim = lat_dim

which are outside  the def train(): code, the def train looks like this:
def train():
    img_list=[]
    iters=0
    for epoch in range(num_epochs):
        for i,data in enumerate(dataloader):

Maybe i’m being a bit slow, but i don’t understand how to get the dataloader to use the multi processing?