diff --git a/transformer/tensorflow/transformer/transformer_main.py b/transformer/tensorflow/transformer/transformer_main.py
index 9f8a7c3..fab2e0a 100644
--- a/transformer/tensorflow/transformer/transformer_main.py
+++ b/transformer/tensorflow/transformer/transformer_main.py
@@ -22,6 +22,9 @@ import argparse
 import os
 import sys
 import tempfile
+import random
+import numpy.random
+
 
 from six.moves import xrange  # pylint: disable=redefined-builtin
 import tensorflow as tf
@@ -383,5 +386,19 @@ if __name__ == "__main__":
            "--train_steps or --train_epochs.",
       metavar="<BT>")
 
+
+  parser.add_argument(
+      "--random_seed", "-rs", type=int, default=None,
+      help="the random seed to use", metavar="<SEED>")
+
   FLAGS, unparsed = parser.parse_known_args()
+  print('Setting random seed = ', FLAGS.random_seed)
+  if FLAGS.random_seed is None:
+    raise Exception('No Random seed given')
+  seed = FLAGS.random_seed
+  random.seed(hash(seed + 1))
+  tf.set_random_seed(hash(seed + 2))
+  numpy.random.seed(hash(seed + 3))
+
+
   tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
