Skip to content

Reproduce problem on tf random #746

Closed

Description

@lsylusiyao

Related to PR #745.

Usually we use tf.set_random_seed(n) to make the training step reproducable. Also, the seed can be set in functions like tf.random.normal(1, seed: 1234).

However, no matter which part I tried, the constant seed doesn't work. I tried to debug into the code and found that they all went to random_ops.cs and ran by tf_with. Here, the seed1 and seed2 will be set to (0,0) or (DEFAULT_GRAPH_SEED, 0) everytime. Though the seeds aren't what I've set above, they're constants so the process SHOULD be reproduced. When I tried in UnitTest, the result couldn't be reproduced either in one time (copy the same code twice in one function) or two times (run the test twice).

Sorry I can't figure out why. Please help me.

BTW, the same test has been tested in Python-TF2 and it worked out.

Activity

  1. added
    bug
    on Feb 8, 2021
  2. Sebastian-roko commented on Feb 23, 2021

    @Sebastian-roko
    Contributor

    In #762 this problem should be mostly fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions