-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
TF models save_pretrained() failed when saved_model=True #14403
Comments
This should have been caught by these tests: https://github.com/huggingface/transformers/blob/master/tests/test_modeling_tf_common.py#L239-L306 But these tests are deactivated as they're too slow, unfortunartely. |
Why are they there then? :D |
Because they were not deactivated at some point, but ended up taking 6+ hours as the number of architectures grew, which we can't do. We need to refactor them to be simpler and faster. Want to take a stab at it? :) |
If I won't ultimately be stabbing myself, yes! |
You can start by running the tests above for a single model, and see if they can't be refactored in a single test, or if some of the time spent cannot be reduced. Also pinging @Rocketknight1 as it might be of interest to him! |
Alright. Thanks for the tip! |
And thank you for offering to help :) |
I feel like this definitely worked in the past. I confirmed that no models are saving correctly with |
Since this worked before (presumably that test passed at -some- point!), most likely something has changed regarding TensorFlow's save logic in 2.6, which means we might have to reassess how we use decorators like |
Alternatively, this may be caused by my PR here, which made changes to the saving/loading of TF models. I'll try a version of Transformers before that to see if the issue is still there. EDIT: Still happens before my PR, so that's not the problem. |
Update: Bug still occurs in TF 2.5. |
@shabie Just to let you know, we refactored a lot of those tests quite urgently when we realized that lack of coverage was causing serious problems! This issue should hopefully be resolved now, but if people encounter further difficulties with saving TF models, please comment or file a new issue. |
Environment info
transformers
version: 4.13.0.dev0Who can help
TensorFlow: @Rocketknight1
To reproduce
Error messages:
Expected behavior
model.save_pretrained(..., saved_model=True) should work, because it is used in
test_saved_model_creation_extended()
intest_modeling_tf_common.py
.The text was updated successfully, but these errors were encountered: