google-research / albert

ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
Apache License 2.0
3.24k stars 569 forks source link

How do I set the random seed to reproduce the same result each time? #133

Open HuaYZhao opened 4 years ago

HuaYZhao commented 4 years ago

How do I set the random seed to reproduce the same result each time? I set it up as follows, but it doesn't work

tf.set_random_seed(1)
np.random.seed(1)
random.seed(1)

I'm running the run_squad_v2.py by the way, I run it on the tpu.