mmhuman3d icon indicating copy to clipboard operation
mmhuman3d copied to clipboard

GPU id problems

Open JackieXuu opened this issue 2 years ago • 1 comments

When I use gpu 6

python tools/train.py configs/hybrik/resnet34_hybrik_mixed.py --work-dir hybrik --gpu-ids 6 --no-validate

It always shows

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:6! (when checking argument for argument weight in method wrapper__cudnn_convolution)

JackieXuu avatar Nov 23 '22 03:11 JackieXuu

It may be caused by

        for k, _ in labels.items():
            labels[k] = labels[k].cuda()

        trans_inv = labels.pop('trans_inv')
        intrinsic_param = labels.pop('intrinsic_param')
        joint_root = labels.pop('joint_root')
        depth_factor = labels.pop('depth_factor')

        if self.backbone is not None:
            img = img.cuda().requires_grad_()

in mmhuman3d/models/architectures/hybrik.py, Can you guys create a PR to fix this?

JackieXuu avatar Nov 23 '22 04:11 JackieXuu