-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Airsim crashes during training for reinforcement learning #123
Comments
Are you using moveOnSpline as your "action" - aka your policy is spitting out target waypoints and/or velocities which are being sent to moveOnSpline APIs? |
No, I am using moveByVelocityAsync. I only need to move the drone a little at each step based on output of my policy function, so there is no need to use moveOnSpline. I am sending every 100 millisecond a move action to the drone. I also tried different time steps but always got the same error. |
Hmm, so this might be caused by drone_2 then. As that error message is associated with moveOnSpline. |
I did it but there was no difference. The only way to prevent this error is to load the environment again, but that makes my training very slow and it is impossible to train a reinforcement learning model with that speed. |
@kavehkamali hmm, so to repro this - I'll call the dummy_reset function in a loop by modifying this script : https://github.com/microsoft/AirSim-NeurIPS2019-Drone-Racing/blob/master/tests/test_reset.py. If you have a better way to help us repro this, let me know. |
Alright, I am able to repro it with this script https://gist.github.com/madratman/e617b53ec20c5f38a7d10633ba3a42c9#file-airsim_neurips_reset_episode_crash_repro-py. Looking into it |
Alright, you just need to sleep a bit after the call to |
I updated the gist https://gist.github.com/madratman/e617b53ec20c5f38a7d10633ba3a42c9 one more time and increased the amount of sleep b/w With 0.5 s of sleep, I did see the crash happen after some time, but 1 second is proving to be stable for more than half an hour. |
Thank you for the update, I will try this. |
Is it working for you now? |
Oh is this where those crashes come from? Sleeping for 1.0s is super costy, though. (Edit: oh, we are apparently not talking about the same crashes) |
I am running the simulation on 20 clock, so sleeping 1 second is too much for me. |
@madratman Also, the ip of the competitor drone is hard coded in the API. I had to change the API to be able to set the ip for the competitor drone. |
I've update the airsim linux v0.3 training binaries, the pythonclient to 1.1.1, and the gist There seems to be one rare edge case, which seems to happen when reset is called from another thread at the same time when drone_2 is finishing its takeoff and starting the fly_through_all_gates..() call. At that point, I think the sim is freezing. yep, yann, we were talking about different things. I just tagged you to check if you had seen this |
Thanks! |
Hi @madratman @kavehkamali May I ask u how to remove the competitor drone in tier 1 environment? and how to turn off the graphic in tier 1? |
@changpowei I had a similar issue where the AirSim Unreal engine kept crashing in the middle of an episode. For me I was making frequent updates to moveOnSplineAsync(), and it would randomly crash. I tried the fix suggested here: #94 (def dummy_reset). I placed the reset function at the end of each episode and now my code runs without crashing AirSim. I just ran it for about 1.5 hrs with no issues. |
I am using reinforcement learning to train my model. But the AirSim engine crashes after a few hundreds of episodes. Before crashing its gives the following error multiple times:
and finally I have this error:
The text was updated successfully, but these errors were encountered: