facebookresearch / agenthive

AgentHive provides the primitives and helpers for a seamless usage of robohive within TorchRL.
32 stars 4 forks source link

Error in running set_info_dict_reader #6

Closed ShahRutav closed 1 year ago

ShahRutav commented 1 year ago

While running the code, it leads to an error:

Traceback (most recent call last):
  File "test.py", line 24, in <module>
    env = env.set_info_dict_reader(info_dict_reader=reader)
  File "/home/rutavms/research/robohive/latest/rl/torchrl/envs/gym_like.py", line 284, in set_info_dict_reader
    self.observation_spec[info_key] = spec
  File "/home/rutavms/research/robohive/latest/rl/torchrl/data/tensor_specs.py", line 1257, in __setitem__
    raise RuntimeError(
RuntimeError: Setting a new attribute (solved) on another device (cpu against cuda:0). All devices of CompositeSpec must match.

I locally fixed in torchRL by simply adding spec.to(self.device) here

vmoens commented 1 year ago

closed as of https://github.com/pytorch/rl/pull/824