CityBrainChallenge / KDDCup2021-CityBrainChallenge-starter-kit

77 stars 40 forks source link

Running Error #1

Closed BruceChen2017 closed 3 years ago

BruceChen2017 commented 3 years ago

When running python3 demo.py, it gives me error:

Traceback (most recent call last):
  File "demo.py", line 13, in <module>
    gym_dict=gym_cfg_instance.cfg
  File "/usr/local/lib/python3.7/dist-packages/gym/envs/registration.py", line 145, in make
    return registry.make(id, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/gym/envs/registration.py", line 90, in make
    env = spec.make(**kwargs)
  File "/usr/local/lib/python3.7/dist-packages/gym/envs/registration.py", line 60, in make
    env = cls(**_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/CBEngine/envs/CBEngine.py", line 18, in __init__
    self.eng = citypb.Engine(self.simulator_cfg_file,thread_num)
IndexError: basic_string::at: __n (which is 18446744073709551615) >= this->size() (which is 2)
zhyliu00 commented 3 years ago

Thanks for your comment. Incorrect format of cfg/simulator.cfg could raise this error. If your operating system is Windows and you have set git config --global core.autocrlf true , when you clone this repo, git will automatically add CR to cfg/simulator.cfg. This will lead to your error in Linux of the docker container. So please change cfg/simulator.cfg from CRLF to LF after cloning this repo.

BruceChen2017 commented 3 years ago

@wrnge Thanks!

BruceChen2017 commented 3 years ago

@wrnge Maybe you can add this problem in the readme.

zhyliu00 commented 3 years ago

Thanks for your suggestion. We have added this issue to reame.