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

Exception not caught in tests (keras custom layers) #969

Open
Wauplin opened this issue Aug 8, 2022 · 0 comments
Open

Exception not caught in tests (keras custom layers) #969

Wauplin opened this issue Aug 8, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Wauplin
Copy link
Contributor

Wauplin commented Aug 8, 2022

In test_push_to_hub_model_kwargs and test_save_pretrained_kwargs_load_fails_without_traces, it seems that the tests are not working as expected. They should apparently check that loading from pretrained weights raises an exception if custom layers are used.

Tests implementation are:

        (...)
        from_pretrained_keras(f"{WORKING_REPO_DIR}/{REPO_NAME}")
        self.assertRaises(ValueError, msg="Exception encountered when calling layer*")

instead of something like:

       (...)
       with self.assertRaises(ValueError, msg="Exception encountered when calling layer*"):
            from_pretrained_keras(f"{WORKING_REPO_DIR}/{REPO_NAME}")

In the end, the from_pretrained_keras call works without exception. @merveenoyan @osanseviero I am not very familiar with the "custom layer problem" in Keras but I saw the tests have been introduced by this PR. Could you have a look and see if there is an actual problem with the layers ? Thanks in advance !

You can find test implementations here and here.

@Wauplin Wauplin changed the title Tests not working as expected Exception not caught in tests (keras custom layers) Aug 8, 2022
@Wauplin Wauplin added the bug Something isn't working label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants