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

Change device_id -> device#66

Open
chunyang wants to merge 1 commit intofacebookresearch:mainfrom
chunyang:device-id
Open

Change device_id -> device#66
chunyang wants to merge 1 commit intofacebookresearch:mainfrom
chunyang:device-id

Conversation

@chunyang
Copy link
Copy Markdown

@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
Copy Markdown
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.

3 participants