Skip to content

'video_recorder' attribute error #659

@shammeer-s

Description

@shammeer-s

I was attempting to use my custom version of a DQN for ethical decision-making in an autonomous vehicle, but I encountered an error. I then tried running the pre-defined code examples, specifically the sb3_highway_dqn.ipynb notebook in Colab, but the issue persisted. Am I missing something?

/usr/local/lib/python3.12/dist-packages/jupyter_client/session.py:203: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  return datetime.utcnow().replace(tzinfo=utc)
Test episodes:   0%
 0/3 [00:00<?, ?it/s]
/usr/local/lib/python3.12/dist-packages/jupyter_client/session.py:203: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  return datetime.utcnow().replace(tzinfo=utc)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[/tmp/ipython-input-3517757080.py](https://localhost:8080/#) in <cell line: 0>()
      5     while not done:
      6         action, _ = model.predict(obs, deterministic=True)
----> 7         obs, reward, done, truncated, info = env.step(int(action))
      8 env.close()
      9 show_videos()

7 frames
[/usr/local/lib/python3.12/dist-packages/highway_env/envs/common/abstract.py](https://localhost:8080/#) in _automatic_rendering(self)
    335         """
    336         if self.viewer is not None and self.enable_auto_render:
--> 337             if self._record_video_wrapper and self._record_video_wrapper.video_recorder:
    338                 self._record_video_wrapper.video_recorder.capture_frame()
    339             else:

AttributeError: 'RecordVideo' object has no attribute 'video_recorder'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions