GT-STAR-Lab / cap-comm

Generalization of Heterogeneous Multi-Robot Policies via Awareness and Communication of Capabilities | CoRL 2023
https://sites.google.com/view/cap-comm
Apache License 2.0
6 stars 2 forks source link

Fail to register the "HeterogeneousSensorNetwork-v0" to gym #1

Closed Yuxin916 closed 9 months ago

Yuxin916 commented 10 months ago

Hi,

Thank you for your work! When i am running the run_MLP_ID_4_agents_HSN.sh, the following error comes out. It seems to fail in the environment registration. Could you please help with it? Thank you!

Traceback (most recent call last): File "/home/tsaisplus/anaconda3/envs/MARBLER/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/tsaisplus/anaconda3/envs/MARBLER/lib/python3.8/multiprocessing/process.py", line 108, in run self._target(*self._args, self._kwargs) File "/home/tsaisplus/MuRPE_base/cap-comm/src/runners/parallel_runner.py", line 226, in env_worker env = env_fn.x() File "/home/tsaisplus/MuRPE_base/cap-comm/src/envs/init.py", line 17, in env_fn return env(kwargs) File "/home/tsaisplus/MuRPE_base/cap-comm/src/envs/init.py", line 85, in init self._env = TimeLimit(gym.make(f"{key}"), max_episode_steps=time_limit) File "/home/tsaisplus/anaconda3/envs/MARBLER/lib/python3.8/site-packages/gym/envs/registration.py", line 235, in make return registry.make(id, **kwargs) File "/home/tsaisplus/anaconda3/envs/MARBLER/lib/python3.8/site-packages/gym/envs/registration.py", line 128, in make spec = self.spec(path) File "/home/tsaisplus/anaconda3/envs/MARBLER/lib/python3.8/site-packages/gym/envs/registration.py", line 203, in spec raise error.UnregisteredEnv("No registered env with id: {}".format(id)) gym.error.UnregisteredEnv: No registered env with id: HeterogeneousSensorNetwork-v0 Process Process-16: Traceback (most recent call last): File "/home/tsaisplus/anaconda3/envs/MARBLER/lib/python3.8/site-packages/gym/envs/registration.py", line 158, in spec return self.env_specs[id] KeyError: 'HeterogeneousSensorNetwork-v0'

piercehowell commented 10 months ago

Hi @Yuxin916! Thanks for sharing the error you encountered. Did you run pip install -e . within the MARBLER fork? Additionally, have you tested that installation of MARBLER was successful?

Best, Pierce

Yuxin916 commented 10 months ago

Hi, Thank you! I try to reinstall everything and this problem seems to be solved. When i run the HeterogeneousSensorNetwork scenario in robotarium_gym/main.py, it is working. Despite i commented line 148 from robotarium_gym/utilities/misc.py "episodeConnectivity.append(info["connectivity"])"

However, i have encountered another problem when running the run_MLP_ID_4_agents_HSN.sh still. This time is:

[ERROR 19:56:17] pymarl Failed after 0:00:03! Traceback (most recent calls WITHOUT Sacred internals): File "/home/tsaisplus/MuRPE_base/cap-comm/src/main.py", line 166, in main run(_run, _config, _log) File "/home/tsaisplus/MuRPE_base/cap-comm/src/run.py", line 57, in run run_sequential(args=args, logger=logger) File "/home/tsaisplus/MuRPE_base/cap-comm/src/run.py", line 192, in run_sequential episode_batch = runner.run(test_mode=False) File "/home/tsaisplus/MuRPE_base/cap-comm/src/runners/parallel_runner.py", line 196, in run cur_stats.update({k: sum(d.get(k, 0) for d in infos) for k in set.union([set(d) for d in infos])}) File "/home/tsaisplus/MuRPE_base/cap-comm/src/runners/parallel_runner.py", line 196, in cur_stats.update({k: sum(d.get(k, 0) for d in infos) for k in set.union([set(d) for d in infos])}) TypeError: unsupported operand type(s) for +: 'int' and 'list'

Process finished with exit code 1

Instead, i replace the environment from HSN to PredatorCapturePrey, it is training well. This seems to be a problem with "info" that come out from HSN's env.step.

Best Regards Yuxin