Here’s how your code should look:
model = torch.nn.DataParallel(Model(args), device_ids=arg.gpu)
for epoch in range(epochs+1):
    model.train()
    for step, (original, keypoints) in enumerate(train_loader):
        outputs = model(original, keypoints)
        <do some training>

Why does this work? For nn.DataParallel, the input tensors can be on any device, even cpu. The module automatically transfers the called arguments to the appropriate cuda device.
What was the issue with your code? torch.device is used to define one and only one device. It can only accept the format ‘cuda:x’/‘cuda’/‘cpu’.