Maxpridy / gym-gazebo-turtlebot-RL

1 stars 1 forks source link

Tried to reset environment which is not done #1

Open yangningbo666 opened 6 years ago

yangningbo666 commented 6 years ago

EP 203 - 1001 timesteps - last100 Steps : 146 - Cumulated R: 2214.55 Eps=0.36 Time: 0:53:49 Traceback (most recent call last): File "2circuit2_turtlebot_lidar_dqn.py", line 334, in <module> observation = env.reset() File "/home/yang/gym/gym/core.py", line 104, in reset return self._reset() File "/home/yang/gym/gym/wrappers/monitoring.py", line 38, in _reset self._before_reset() File "/home/yang/gym/gym/wrappers/monitoring.py", line 189, in _before_reset self.stats_recorder.before_reset() File "/home/yang/gym/gym/monitoring/stats_recorder.py", line 68, in before_reset raise error.Error("Tried to reset environment which is not done. While the monitor is active for {}, you cannot call reset() unless the episode is over.".format(self.env_id)) gym.error.Error: Tried to reset environment which is not done. While the monitor is active for GazeboCircuit2TurtlebotLidarNn-v0, you cannot call reset() unless the episode is over.

when i python 'circuit2_turtlebot_lidar_dqn.py',i met wiht this error.I tried to debug it by google and github.But I see you had code what they said well.So i am confused.Could you give me advice to debug it well.E-mail or github is both OK.My email is 365220121@qq.com

Maxpridy commented 6 years ago

First of all, In fact, I don't know. Sorry...

Do you get this error while running DQN for a while? I also encountered this error. I just wished to run it several times and get over it. sometimes it is done.

It seems to be a problem of the environment itself, perhaps ... I think it's better to contact the gym-gazebo, the original git page.

What I did was just apply the TRPO algorithm.

yangningbo666 commented 6 years ago

when the timesteps come to 1001,beyond 1000 it crushed. Some answers is 'Add "env._max_episode_steps = your_value You can set your_value to 1000. " below "env = gym.make('GazeboCircuit2TurtlebotLidarNn-v0')"'. Have you tried? I tried but the robot can't learn anything reward always is -160 .If you have time, could u try for once?And tell me what happend? Good Luck to you!

Maxpridy commented 6 years ago

https://github.com/erlerobot/gym-gazebo/blob/master/examples/turtlebot/circuit2_turtlebot_lidar_dqn.py in 360 line, you can decide how many times you run.

DQN is better than qlearn or sarsa, but it also does not learn very well. There are many cases where DQN converges to a bad place. I have tried it five times and have confirmed that it has done well twice. 2/5 probability, which is the problem of the algorithm itself.

yangningbo666 commented 6 years ago

I understand by your explaination for DQN.Thanks. if (t >= 1000): print ("reached the end! :D") done = True Why it didn't break the loop and the timesteps come to 1001?And this lead the error?