Skip to content
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

TD3 not deterministic #838

Closed
tguegan opened this issue May 2, 2020 · 4 comments
Closed

TD3 not deterministic #838

tguegan opened this issue May 2, 2020 · 4 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists RTFM Answer is the documentation

Comments

@tguegan
Copy link

tguegan commented May 2, 2020

Hi all,

Can't get the same results twice with TD3 but it works with PPO2.

import gym
from stable_baselines import TD3
from stable_baselines.td3.policies import MlpPolicy

env = gym.make('Pendulum-v0')
# env.seed(12345) not working
# env.reset()
model = TD3(MlpPolicy, env, verbose = 1, seed = 12345, n_cpu_tf_sess = 1)
model.learn(total_timesteps = 50000, log_interval = 10)
model.save("td3_pendulum")

System Info
Conda env, Python 3.6.9, TF 1.14 CPU from conda-forge, SB 2.10.0 from pip

Additional context
I need to study parameters effect on my custom env, but I'm not able to remove the randomness so far. Any idea ?

Thibaut

@araffin araffin added duplicate This issue or pull request already exists RTFM Answer is the documentation labels May 2, 2020
@araffin
Copy link
Collaborator

araffin commented May 2, 2020

Hello,

As mentioned in the documentation (and in the PR #492), TD3 sometimes fail to be deterministic for obscure reasons.

Apparently, the tensorflow version affects the results. I could get deterministic results with TF 1.8.0 on cpu (but not with higher versions...).

PS: I could not find the other duplicated issue yet, but I'm pretty sure there was one...

@araffin araffin added the bug Something isn't working label May 2, 2020
@tguegan
Copy link
Author

tguegan commented May 2, 2020

Couldn't find that in the TD3 doc but ok I'll try with TF 1.8 ! Thanks.

@araffin
Copy link
Collaborator

araffin commented May 2, 2020

Couldn't find that in the TD3 doc but ok I'll try with TF 1.8 ! Thanks.

See the note here

@tguegan
Copy link
Author

tguegan commented May 2, 2020

Ok thanks again! Indeed it works with TF 1.8.0 I'm closing the issue then!

@tguegan tguegan closed this as completed May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists RTFM Answer is the documentation
Projects
None yet
Development

No branches or pull requests

2 participants