-
Notifications
You must be signed in to change notification settings - Fork 111
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
BUG: Nondeterminisitc behaviour of MetaDriveEnv #758
Comments
Thanks for raising this! May I ask is this problem caused by:
|
Hi @pengzhenghao, Answering your questions:
However those are only my suggestions, feel free to look at the code, and share your thoughts. |
Thanks for sharing the code! I do some experiments:
I notice that you are using absolute equal to do assertions. We usually use np's almost equal to help avoid floating point issue. So I've made a new test script for this: With this new script I can verified that the relative error <0.1% if we rollout the expert for 50 steps. <1e-6 relative error if we rollout the expert for 1 step. Therefore, I think there is no bug in metadrive. Some tiny floating point number error is inevitable. |
Hi MetaDrive team,
I believe I discovered a bug, in resetting the MetaDriveEnv resulting in nondeterminism.
MetaDrive simulation supposed to be deterministic but even when I use the enviroment and reset it with same with same seed resulting traces are not identical. Cosider following code adapted from examples:
When I was analyzing traces (step info for each timestep) from diffrent repetitions I found slight diffrences probably comming from floating point number arithemtic. Those diffrences (error) between traces is magnified, the longer the episode is.
Suspecting that
.reset()
function doesn't clear the state properly I started initializing the enviroment for each repetition, and closing at the end.Above solved an issue and each traces produced are exacly the same (fully deterministic).
Please see my notebook reproducing the bug.
Conda env
The text was updated successfully, but these errors were encountered: