When I run the examples such as psro_poker, maddpg_mpe, I set the config "use_cuda" as True, but got the error as follow:
2022-04-20 19:30:20,818 ERROR worker.py:80 -- Unhandled error (suppress with RAY_IGNORE_UNHANDLED_ERRORS=1): ray::RolloutWorker.simulation() (pid=32314, ip=172.28.78.34, repr=<matf.rollout.rollout_worker.RolloutWorker object at 0x7f083bb10fd0>)
(pid=32320) File "/home/qianmd/work/test/matf/matf/rollout/base_worker.py", line 447, in simulation
(pid=32320) role="simulation",
(pid=32320) File "/home/qianmd/work/test/matf/matf/rollout/rollout_worker.py", line 161, in sample
(pid=32320) for ret in rets:
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/ray/util/actor_pool.py", line 65, in map
(pid=32320) yield self.get_next()
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/ray/util/actor_pool.py", line 178, in get_next
(pid=32320) return ray.get(future)
(pid=32320) ray.exceptions.RayTaskError(RuntimeError): ray::Stepping.run() (pid=32309, ip=172.28.78.34, repr=<matf.rollout.rollout_func.Stepping object at 0x7f243ce38190>)
(pid=32320) File "/home/qianmd/work/test/matf/matf/rollout/rollout_func.py", line 447, in run
(pid=32320) dataset_server=self._dataset_server if task_type == "rollout" else None,
(pid=32320) File "/home/qianmd/work/test/matf/matf/rollout/rollout_func.py", line 276, in env_runner
(pid=32320) active_policy_inputs, agent_interfaces, episodes
(pid=32320) File "/home/qianmd/work/test/matf/matf/rollout/rollout_func.py", line 155, in _do_policy_eval
(pid=32320) ) = interface.compute_action(**inputs) # 根据每个env_agent_id的态势信息,rnn_state, done 计算动作
(pid=32320) File "/home/qianmd/work/test/matf/matf/envs/agent_interface.py", line 268, in compute_action
(pid=32320) rets = self.policies[policy_id].compute_action(*args, **kwargs)
(pid=32320) File "/home/qianmd/work/test/matf/matf/algorithm/dqn/policy.py", line 88, in compute_action
(pid=32320) logits = torch.softmax(self.critic(observation), dim=-1)
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
(pid=32320) result = self.forward(*input, **kwargs)
(pid=32320) File "/home/qianmd/work/test/matf/matf/algorithm/common/model.py", line 106, in forward
(pid=32320) pi = self.net(obs)
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
(pid=32320) result = self.forward(*input, **kwargs)
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/torch/nn/modules/container.py", line 100, in forward
(pid=32320) input = module(input)
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
(pid=32320) result = self.forward(*input, **kwargs)
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 87, in forward
(pid=32320) return F.linear(input, self.weight, self.bias)
(pid=32320) File "/home/qianmd/anaconda3/envs/malib/lib/python3.7/site-packages/torch/nn/functional.py", line 1370, in linear
(pid=32320) ret = torch.addmm(bias, input, weight.t())
(pid=32320) RuntimeError: Expected object of device type cuda but got device type cpu for argument #2 'mat1' in call to _th_addmm
(pid=32314) Exception ignored in: 'ray._raylet.task_execution_handler'