AttributeError: ‘**’ object has no attribute 'to'

I’m a newer to pytorch. I run a model by pytorch, and use net.to(device) load data to GPU. The error is "AttributeError: ‘**’ object has no attribute ‘to’ ",
what can i do to handle it?

The pytorch version is 0.3.1

You could update PyTorch to 0.4.1 or use .cpu() or .cuda() in older versions.
I would recommend updating PyTorch. You can find the install instructions on the website.

oh, ok, i’ll try it. thanks:grinning: