Hi,
I have access to 4 GPUs, and would like to use 2 for my task training with DataParrallel. From what I understand, instructing torch which GPUs to use is done by:
task = nn.DataParrallel(model, device_ids=[1, 2]) to use GPUs 1 and 2.
However, this yields the following assertion error: “raise AssertionError(“Invalid device id”)”.
From my looking at previous answers (apologize I’m not sure how to link them, first post), this error indicates that I do not have GPUs 1 or 2 available to me. However, this does not appear to be the case.
For instance, extracting the device properties in the python interpreter (same environment) works without issue:

Screen Shot 2019-03-30 at 2.29.56 PM.png1517×47 4.85 KB

Is there something I’m missing with regards to assigning the model to specific device ids? Or recommendations on other methods through which I can try accomplish this task?
Thank you very much for your time!