IntelLabs / coach

Reinforcement Learning Coach by Intel AI Lab enables easy experimentation with state of the art Reinforcement Learning algorithms
https://intellabs.github.io/coach/
Apache License 2.0
2.33k stars 461 forks source link

run carla env : observation assert False AssertionError #80

Closed zdx3578 closed 6 years ago

zdx3578 commented 6 years ago

carla version 0.7 and 0.71 both same error and tensorflow=cpu 14.1 and tensorflow-gpu=1.6 is samw error

(coach_env) sdc@frankwang-Tri01:~/Projects/coach$ python3 coach.py -p Carla_A3C -n 1 /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Warning: failed to import the following packages - RoboSchool, Neon, ViZDoom, PyBullet, GymExtensions Please enter an experiment name: c

Using tensorflow framework Traceback (most recent call last): File "coach.py", line 271, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 136, in init self.reset(True) File "/home/sdc/Projects/coach/environments/environment_wrapper.py", line 165, in reset self._restart_environment_episode(force_environment_reset) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 229, in _restart_environment_episode observation = self.step([1.0, 0])['observation'] File "/home/sdc/Projects/coach/environments/environment_wrapper.py", line 140, in step self._update_state() File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 185, in _update_state 'measurements': [measurements.player_measurements.forward_speed], File "/home/sdc/Projects/coach/environments/environment_wrapper.py", line 81, in observation assert False AssertionError


Results stored at: ./experiments/c/19_03_2018-23_30 Total runtime: 0:00:29.358656


Do you want to discard the experiment results (Warning: this cannot be undone)? (y/N)

zdx3578 commented 6 years ago

3 gpus and train in 4 thread

(coach_env) sdc@frankwang-Tri01:~/Projects/coach$ python3 coach.py -p Carla_A3C -n 4 /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Warning: failed to import the following packages - RoboSchool, GymExtensions, PyBullet, ViZDoom, Neon Please enter an experiment name: c

Distributed Training /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters E0319 23:24:41.996985406 12448 ev_epoll1_linux.c:1051] grpc epoll fd: 3 /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters /home/sdc/Projects/coach/coach_env/lib/python3.5/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters E0319 23:24:42.861840739 12456 ev_epoll1_linux.c:1051] grpc epoll fd: 3 E0319 23:24:42.964169270 12454 ev_epoll1_linux.c:1051] grpc epoll fd: 3 E0319 23:24:42.964269364 12455 ev_epoll1_linux.c:1051] grpc epoll fd: 3 E0319 23:24:42.964458426 12453 ev_epoll1_linux.c:1051] grpc epoll fd: 3 E0319 23:24:43.027589433 12452 ev_epoll1_linux.c:1051] grpc epoll fd: 3 Traceback (most recent call last): File "./parallel_actor.py", line 101, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 96, in init self.game.connect() File "/data/env/carla/PythonClient/carla/client.py", line 49, in connect self._world_client.connect(connection_attempts) File "/data/env/carla/PythonClient/carla/tcp.py", line 49, in connect self._reraise_exception_as_tcp_error('failed to connect', error) File "/data/env/carla/PythonClient/carla/tcp.py", line 98, in _reraise_exception_as_tcp_error raise TCPConnectionError('%s%s: %s' % (self._logprefix, message, exception)) carla.tcp.TCPConnectionError: (localhost:33640) failed to connect: [Errno 111] Connection refused Traceback (most recent call last): File "./parallel_actor.py", line 101, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 96, in init self.game.connect() File "/data/env/carla/PythonClient/carla/client.py", line 49, in connect self._world_client.connect(connection_attempts) File "/data/env/carla/PythonClient/carla/tcp.py", line 49, in connect self._reraise_exception_as_tcp_error('failed to connect', error) File "/data/env/carla/PythonClient/carla/tcp.py", line 98, in _reraise_exception_as_tcp_error raise TCPConnectionError('%s%s: %s' % (self._logprefix, message, exception)) carla.tcp.TCPConnectionError: (localhost:53351) failed to connect: [Errno 111] Connection refused Traceback (most recent call last): File "./parallel_actor.py", line 101, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 96, in init self.game.connect() File "/data/env/carla/PythonClient/carla/client.py", line 49, in connect self._world_client.connect(connection_attempts) File "/data/env/carla/PythonClient/carla/tcp.py", line 49, in connect self._reraise_exception_as_tcp_error('failed to connect', error) File "/data/env/carla/PythonClient/carla/tcp.py", line 98, in _reraise_exception_as_tcp_error raise TCPConnectionError('%s%s: %s' % (self._logprefix, message, exception)) carla.tcp.TCPConnectionError: (localhost:60571) failed to connect: [Errno 111] Connection refused Traceback (most recent call last): File "./parallel_actor.py", line 101, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 96, in init self.game.connect() File "/data/env/carla/PythonClient/carla/client.py", line 49, in connect self._world_client.connect(connection_attempts) File "/data/env/carla/PythonClient/carla/tcp.py", line 49, in connect self._reraise_exception_as_tcp_error('failed to connect', error) File "/data/env/carla/PythonClient/carla/tcp.py", line 98, in _reraise_exception_as_tcp_error raise TCPConnectionError('%s%s: %s' % (self._logprefix, message, exception)) carla.tcp.TCPConnectionError: (localhost:38677) failed to connect: [Errno 111] Connection refused Traceback (most recent call last): File "./parallel_actor.py", line 101, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 96, in init self.game.connect() File "/data/env/carla/PythonClient/carla/client.py", line 49, in connect self._world_client.connect(connection_attempts) File "/data/env/carla/PythonClient/carla/tcp.py", line 49, in connect self._reraise_exception_as_tcp_error('failed to connect', error) File "/data/env/carla/PythonClient/carla/tcp.py", line 98, in _reraise_exception_as_tcp_error raise TCPConnectionError('%s%s: %s' % (self._logprefix, message, exception)) carla.tcp.TCPConnectionError: (localhost:46727) failed to connect: [Errno 111] Connection refused


Results stored at: ./experiments/c/19_3_2018-23_24_0 Total runtime: 0:00:17.242453


Do you want to discard the experiment results (Warning: this cannot be undone)? (y/N)

zdx3578 commented 6 years ago

Using tensorflow framework Traceback (most recent call last): File "coach.py", line 271, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 96, in init self.game.connect() File "/data/env/carla/PythonClient/carla/client.py", line 49, in connect self._world_client.connect(connection_attempts) File "/data/env/carla/PythonClient/carla/tcp.py", line 49, in connect self._reraise_exception_as_tcp_error('failed to connect', error) File "/data/env/carla/PythonClient/carla/tcp.py", line 98, in _reraise_exception_as_tcp_error raise TCPConnectionError('%s%s: %s' % (self._logprefix, message, exception)) carla.tcp.TCPConnectionError: (localhost:44196) failed to connect: [Errno 111] Connection refused

fix by: and open server then add time sleep;

change: @property def measurements(self): assert True

@measurements.setter
def measurements(self, value):
    assert True

@property
def observation(self):
    assert True

@observation.setter
def observation(self, value):
    assert True

to Ture

error: Using tensorflow framework Traceback (most recent call last): File "coach.py", line 271, in env_instance = create_environment(tuning_parameters) File "/home/sdc/Projects/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 136, in init self.reset(True) File "/home/sdc/Projects/coach/environments/environment_wrapper.py", line 165, in reset self._restart_environment_episode(force_environment_reset) File "/home/sdc/Projects/coach/environments/carla_environment_wrapper.py", line 232, in _restart_environment_episode observation = self.step([1.0, 0])['observation'] KeyError: 'observation'

ciumonk commented 6 years ago

Hi,

Checkout commit 125c7ee38d413e4709271292c473f5930196b137 ! The latest commit seems to have broken quite a number of things..

zdx3578 commented 6 years ago
# @property
# def observation(self):
#     assert False
#
# @observation.setter
# def observation(self, value):
#     assert False

        #observation = self.step([1.0, 0]).state['observation']

    observation = self.preprocess_observation(self.env.observation)
zdx3578 commented 6 years ago

@ciumonk thanks!

itaicaspi-intel commented 6 years ago

We pushed some fixes to Carla in the following commit: f31159aad6e84d738732d22fc8aa1509c6cda275 This should solve the measurements / observation issues