mschrader15 / reinforcement-learning-sumo

Reinforcement Learning + traffic microsimulation (via SUMO). Uses Ray RLLIB and forces SUMO into the OpenAI Gym Framework
https://maxschrader.io/reinforcement-learning-and-sumo
45 stars 9 forks source link

TypeError: Cannot instantiate typing.Union #4

Closed kimchuan-utem closed 2 years ago

kimchuan-utem commented 2 years ago

may i know is that a bug or python version incompatible?

(app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ which python /home/ubuntu/.pyenv/shims/python (app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ python --version Python 3.9.13+ (app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ python train.py

Traceback (most recent call last): File "/media/ubuntu/diskB/reinforcement-learning-sumo/train.py", line 6, in from rl_sumo.helpers.register_environment import make_create_env File "/media/ubuntu/diskB/reinforcement-learning-sumo/rl_sumo/helpers/register_environment.py", line 6, in def make_create_env(env_params, sim_params, version=0) -> Union(str, object): File "/home/ubuntu/.pyenv/versions/3.9-dev/lib/python3.9/typing.py", line 344, in call raise TypeError(f"Cannot instantiate {self!r}") TypeError: Cannot instantiate typing.Union

mschrader15 commented 2 years ago

Hi @kimchuan-utem, appears that was a bug. Should by fixed in https://github.com/mschrader15/reinforcement-learning-sumo/commit/a8ffc1a95d553ad843c9097305b69f499ae56532