Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Change device_id -> device #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chunyang
Copy link

@chunyang chunyang commented Nov 6, 2017

Per this change in PyTorch: pytorch/pytorch#2872 (post v0.2.0)

Without the patch, I see the following error:

Traceback (most recent call last):
  File "train.py", line 24, in <module>
    model = env["model_loaders"][0].load_model(GC.params)
  File "/home/cyang/src/ELF/rlpytorch/model_loader.py", line 95, in load_model
    model.cuda(device_id=args.gpu)
TypeError: cuda() got an unexpected keyword argument 'device_id'

@yuandong-tian
Copy link
Contributor

better just use

model.cuda(args.gpu)

to be compatible with both old and new pytorch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants