ELF
ELF copied to clipboard
Change device_id -> device
Per this change in PyTorch: https://github.com/pytorch/pytorch/pull/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'
better just use
model.cuda(args.gpu)
to be compatible with both old and new pytorch.