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

Make converter hashtable test not overly specific #7249

Merged

Conversation

mattsoulanille
Copy link
Member

@mattsoulanille mattsoulanille commented Jan 5, 2023

tfjs-converter's saved model conversion test for hashtable depends on the exact names of the hashtable weights it saves, but these names are generated and may change between versions of TF. This was observed when syncing into google3, which is using tf 2.12. This PR prevents the test from checking the name of the hashtable weights.

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

tfjs-converter's saved model conversion test for hashtable depends on the exact names of the hashtable weights it saves, but these names are generated and may change between versions of TF. This was observed when syncing into google3, which is using tf 2.12. This PR prevents the test from checking the name of the hashtable weights.
Copy link
Collaborator

@Linchenn Linchenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @mattsoulanille and @pyu10055)


tfjs-converter/python/tensorflowjs/converters/tf_saved_model_conversion_v2_test.py line 563 at r1 (raw file):

    self.assertEqual(weights_manifest['weights'][2]['dtype'], 'int32')

    self.assertEqual(weights_manifest, expected_weights_manifest)

self.assertEqual(weights_manifest, expected_weights_manifest)
Is this duplicated with your additions?

Copy link
Member Author

@mattsoulanille mattsoulanille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @Linchenn and @pyu10055)


tfjs-converter/python/tensorflowjs/converters/tf_saved_model_conversion_v2_test.py line 563 at r1 (raw file):

Previously, Linchenn wrote…

self.assertEqual(weights_manifest, expected_weights_manifest)
Is this duplicated with your additions?

Nice catch. Thanks!

Copy link
Collaborator

@Linchenn Linchenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @Linchenn and @mattsoulanille)


tfjs-converter/python/tensorflowjs/converters/tf_saved_model_conversion_v2_test.py line 556 at r1 (raw file):

    self.assertEqual(weights_manifest['paths'], ['group1-shard1of1.bin'])
    self.assertEqual(weights_manifest['weights'][0],
                     {'name': 'unknown_0', 'shape': [], 'dtype': 'int32'})

should skip name for weights[0] too?

Copy link
Member Author

@mattsoulanille mattsoulanille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @Linchenn and @pyu10055)


tfjs-converter/python/tensorflowjs/converters/tf_saved_model_conversion_v2_test.py line 556 at r1 (raw file):

Previously, pyu10055 (Ping Yu) wrote…

should skip name for weights[0] too?

Only the two weights with numbers for names were affected by tf 2.12, so I think it's okay to still check weights[0]. I can change this if you want, though.

@mattsoulanille mattsoulanille merged commit 6e76da9 into tensorflow:master Jan 6, 2023
Linchenn pushed a commit to Linchenn/tfjs that referenced this pull request Jan 9, 2023
tfjs-converter's saved model conversion test for hashtable depends on the exact names of the hashtable weights it saves, but these names are generated and may change between versions of TF. This was observed when syncing into google3, which is using tf 2.12. This PR prevents the test from checking the name of the hashtable weights.

Co-authored-by: Ping Yu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants