starry-sky6688 / MARL-Algorithms

Implementations of IQL, QMIX, VDN, COMA, QTRAN, MAVEN, CommNet, DyMA-CL, and G2ANet on SMAC, the decentralised micromanagement scenario of StarCraft II
1.47k stars 283 forks source link

mavan的cuda有问题.... #93

Closed harnvo closed 2 years ago

harnvo commented 2 years ago

policy.maven.MAVEN里面, cuda部分的代码长这个样子...

    if self.args.cuda:
        self.z_policy.cuda()
        self.eval_rnn.cuda()
        self.target_rnn.cuda()
        self.eval_qmix_net.cuda()
        self.target_qmix_net.cuda()
        self.mi_net.cuda()

然而,cuda()只是一个会返回在GPU的tensor的函数,你还需要让x = x.cuda()才能让x变成在GPU的tensor。 #92

harnvo commented 2 years ago

never mind, 是我阅读PyTorch 文档不仔细,抱歉...