deep-high-resolution-net.pytorch
deep-high-resolution-net.pytorch copied to clipboard
AssertionError: Invalid device id
1.change the code in test.py: model = torch.nn.DataParallel(model,device_ids=cfg.GPUS).cuda() to model = torch.nn.DataParallel(model, device_ids=(0,)).cuda()
I use model = torch.nn.DataParallel(model, device_ids=[0]).cuda()
Instead of directly changing test.py code at
model = torch.nn.DataParallel(model,device_ids=cfg.GPUS).cuda(),
You can execute test.py by giving the list of gpus as a parameter. Example:
python tools/test.py --cfg experiments/coco/hrnet/w32_256x192_adam_lr1e-3.yaml TEST.MODEL_FILE models/pytorch/pose_coco/pose_hrnet_w32_256x192.pth GPUS (0,)
warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
Traceback (most recent call last):
File "gtad_train.py", line 109, in
I face the same problem, I work at google colab. cuda 10.1
1.change the code in test.py: model = torch.nn.DataParallel(model,device_ids=cfg.GPUS).cuda() to model = torch.nn.DataParallel(model, device_ids=(0,)).cuda()
where the test.py located?
Instead of directly changing test.py code at
model = torch.nn.DataParallel(model,device_ids=cfg.GPUS).cuda(), You can execute test.py by giving the list of gpus as a parameter. Example:python tools/test.py --cfg experiments/coco/hrnet/w32_256x192_adam_lr1e-3.yaml TEST.MODEL_FILE models/pytorch/pose_coco/pose_hrnet_w32_256x192.pth GPUS (0,)
But using GPUS(0,) throws syntax error near unexpected token `('....please help
@Shadowwalker10
Please use GPUS [0]. I hope it would resolve issue for you.
instead of !python tools/train.py --cfg experiments/mpii/hrnet/w32_256x256_adam_lr1e-3.yaml, which gives and error like above mentioned from others, I've used !python tools/train.py --cfg experiments/coco/hrnet/w32_256x192_adam_lr1e-3.yaml TEST.MODEL_FILE models/pytorch/pose_coco/pose_hrnet_w32_256x192.pth GPUS [0] and it seems like it's working so far, but what does TEST.MODEL_FILE models/pytorch/pose_coco/pose_hrnet_w32_256x192.pth GPUS [0] do exactly?