salesforce / cove

BSD 3-Clause "New" or "Revised" License
473 stars 93 forks source link

Fail to run on gpu when running testing/example.py #18

Closed Bogerchen closed 6 years ago

Bogerchen commented 6 years ago

I run testing/example.py without Docker, and get an error. CUDA is available on my server. I tried to set the device using torch.device, but still failed. The error information is: RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #3 'index I wonder if example.py could successfully run on GPU without Docker. Thanks a lot.

Bogerchen commented 6 years ago

Solved. The torchtext may be updated. The problem was solved by setting the device argument of data.BucketIterator.splits by torch.device.