GengDavid / pytorch-cpn

A PyTorch re-implementation of CPN (Cascaded Pyramid Network for Multi-Person Pose Estimation)
GNU General Public License v3.0
484 stars 98 forks source link

target.cuda(async=True),在async=True处出现SyntaxError: invalid syntax #25

Open my-hello-world opened 5 years ago

my-hello-world commented 5 years ago

相关资料不是很直观,想问下我直接把

        refine_target_var = torch.autograd.Variable(target7.cuda(async=True))
        valid_var = torch.autograd.Variable(valid.cuda(async=True))

改成如下可以吗?

        refine_target_var = torch.autograd.Variable(target7.cuda())
        valid_var = torch.autograd.Variable(valid.cuda())
Crophone commented 4 years ago

yes.you can use the .cuda() here is the reference