Open yongjulee-etri opened 7 years ago
I'm running into the same issues. It would be very appreciated if you could provide some hint.
Hi guys. I have a branch of gym I was using when I wrote this. I haven't gotten around to cleaning this up for current gym. You can checkout the version of gym on my github. I might have some free time over the summer to setup Travis and everything else.
Main work on this recently has been building the C++ linking. I have a build of SUMO that can run within Python instead of running through traci commands, and I'm getting crazy speedups.
https://github.com/bstriner/pysumo
Goal will be to have gym-traffic use pysumo if available and traci if not.
Cheers
I just checked it was gym 0.7.3 at the time. I'm sure a lot has changed since the beginning of the year.
https://github.com/bstriner/gym/blob/bstriner/gym/version.py
The bstriner
branch combines some changes from several branches.
Thank you for your kind help! This is very helpful information maybe I'm getting it to work now.
Dear Ben,
In my case, I had several errors. What kind of Gym version did you use ?
I used the following packages.
gym (0.8.2) gym-pull (0.1.7) tensorflow (1.0.1) keras-rl (0.3.0) sumo(0.29.0)
I got errors below.
Lee~/Downloads/Transportation/bstriner_Ben/gym-traffic-master/examples$ python example_gym_traffic_dqn.py Using TensorFlow backend. [2017-05-09 09:31:14,954] Making new env: Traffic-Simple-gui-v0 Traceback (most recent call last): File "example_gym_traffic_dqn.py", line 51, in
main(sys.argv[1:])
File "example_gym_traffic_dqn.py", line 47, in main
example(args.gui)
File "example_gym_traffic_dqn.py", line 23, in example
train_env = gym.make('Traffic-Simple-gui-v0')
File "/usr/local/lib/python2.7/site-packages/gym/envs/registration.py", line 161, in make
return registry.make(id)
File "/usr/local/lib/python2.7/site-packages/gym/envs/registration.py", line 119, in make
env = spec.make()
File "/usr/local/lib/python2.7/site-packages/gym/envs/registration.py", line 86, in make
env = cls(self._kwargs)
File "/Users/Lee/Downloads/Transportation/bstriner_Ben/gym-traffic-master/gym_traffic/envs/traffic_env_simple.py", line 19, in init
lanes=lanes, exitloops=exitloops)
File "/Users/Lee/Downloads/Transportation/bstriner_Ben/gym-traffic-master/gym_traffic/envs/traffic_env.py", line 53, in init
self.action_space = spaces.DiscreteToMultiDiscrete(
AttributeError: 'module' object has no attribute 'DiscreteToMultiDiscrete'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, *kargs)
File "/usr/local/lib/python2.7/site-packages/gym/utils/closer.py", line 67, in close
closeable.close()
File "/usr/local/lib/python2.7/site-packages/gym/core.py", line 167, in close
self.render(close=True)
File "/usr/local/lib/python2.7/site-packages/gym/core.py", line 153, in render
return self._render(mode=mode, close=close)
File "/Users/Lee/Downloads/Transportation/bstriner_Ben/gym-traffic-master/gym_traffic/envs/traffic_env.py", line 151, in _render
if self.viewer is not None:
AttributeError: 'TrafficEnvSimple' object has no attribute 'viewer'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(targs, kargs)
File "/usr/local/lib/python2.7/site-packages/gym/utils/closer.py", line 67, in close
closeable.close()
File "/usr/local/lib/python2.7/site-packages/gym/core.py", line 167, in close
self.render(close=True)
File "/usr/local/lib/python2.7/site-packages/gym/core.py", line 153, in render
return self._render(mode=mode, close=close)
File "/Users/Lee/Downloads/Transportation/bstriner_Ben/gym-traffic-master/gym_traffic/envs/traffic_env.py", line 151, in _render
if self.viewer is not None:
AttributeError: 'TrafficEnvSimple' object has no attribute 'viewer'
Lee~/Downloads/Transportation/bstriner_Ben/gym-traffic-master/examples$