huawei-noah / SMARTS

Scalable Multi-Agent RL Training School for Autonomous Driving
MIT License
944 stars 190 forks source link

[Bug Report] `traffic_histories_to_observations.py` script is broken on `master` branch #1976

Closed qianyi-sun closed 1 year ago

qianyi-sun commented 1 year ago

High Level Description

When trying to generate a .pkl file for an naturalistic scenario, the following error occurs:

python smarts/dataset/traffic_histories_to_observations.py /root/driving-smarts-2.competition-scenarios/t1/test/00b635f9-ee79-43f7-91c2-005e7b772c28_agents_1 -o /root/driving-smarts-2.competition-scenarios/t1/test/00b635f9-ee79-43f7-91c2-005e7b772c28_agents_1
WARNING:Client:Connection to Envision failed with: [Errno 111] Connection refused.  Try using `--headless` if not using Envision server.
Using configuration from: /root/SMARTS/smarts/engine.ini
WARNING:ObservationRecorder:No vehicle IDs specifed. Defaulting to ego vehicle (200274)
:device(error): Error adding inotify watch on /dev/input: No such file or directory
:device(error): Error opening directory /dev/input: No such file or directory
Traceback (most recent call last):
  File "smarts/dataset/traffic_histories_to_observations.py", line 425, in <module>
    recorder.collect(args.vehicles_with_sensors, headless=args.headless)
  File "smarts/dataset/traffic_histories_to_observations.py", line 263, in collect
    self._record_data(
  File "smarts/dataset/traffic_histories_to_observations.py", line 333, in _record_data
    obs, _, _, _ = self._smarts.observe_from(list(valid_vehicles))
  File "/root/SMARTS/smarts/core/smarts.py", line 955, in observe_from
    return self._agent_manager.observe_from(
  File "/root/SMARTS/smarts/core/agent_manager.py", line 186, in observe_from
    agent_ids = {
  File "/root/SMARTS/smarts/core/agent_manager.py", line 189, in <setcomp>
    if self._vehicle_has_agent(a_id, v_id)
  File "/root/SMARTS/smarts/core/agent_manager.py", line 163, in _vehicle_has_agent
    assert (
AssertionError: Vehicle `history-vehicle-200274` does not have an agent registered to it to get observations for.
Exception ignored in: <function BulletClient.__del__ at 0x7f05cea4b310>
Traceback (most recent call last):
  File "/root/SMARTS/examples/rl/platoon/.venv/lib/python3.8/site-packages/pybullet_utils/bullet_client.py", line 38, in __del__
TypeError: catching classes that do not inherit from BaseException is not allowed
Segmentation fault

Version

Up to date on master branch

Steps to reproduce the bug

`python smarts/dataset/traffic_histories_to_observations.py <scenario_path> -o <output_dir>`

System info

No response

Error logs and screenshots

No response

Impact (If known)

No response