-
Notifications
You must be signed in to change notification settings - Fork 0
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
Truncate strings to 2500 and remove newlines #2
Comments
Thank you for bringing this up. I will take a look into it. |
@martinber can you post here the complete error message please? A quick fix for your case would be to exclude parameters saved by There are two options. You can define which parameters should be saved
Or exclude parameters from being saved
meanwhile I will take a look how to deal with very large hyperparameters. I would like to avoid automated pruning, since this can result to unexcpected behavior. |
Thank you! This is the error when the hyperparameter is too long and has newlines:
(I cropped the real message because I have lots of hyperparametrs giving similar errors) Yes, I'm not sure of the best solution. The real cause is my code which saves some huge objects as hyperparameters which doesn't make sense, but I don't really have control over the code (it is a code that was logging to Neptune and now I modified to log to Sagemaker). I mean, I can make a PR or a patch myself to my code to save less hyperparameters but I think it would be nice if this library allows some kind of "best effort" mode where it truncates long strings and removes newlines. |
Hello, I wanted to let you know that I don't need anymore this feature, so do it only if you think it is useful for you. In case you are interested: I suspect that Sagemaker Experiments does not have a bright future and it is very unpolished right now. In any case, thank you, this library was very useful for doing some testing! |
Thanks for the feedback. |
I was having a problem where the logger would fail since I was trying to log hyperparameter strings longer than 2500 characters and with newlines.
As a quick fix I solved it by adding this after line 38:
I don't know if you have a better idea. I have to do this because there is code which I do not control, which does something like:
Looks like
save_hyperparameters()
saves as hyperparameters all the arguments of the__init__()
and arguments of typepl.LightningModule
are serialized and saved in SageMaker experiments as a very long string with newlines.The error indicating that the string would be shorter than 2500 is clear to understand, but at the same time I was receiving an error saying something of the sort of "hyperparameter string should match the regex '.*'" which was due to newlines and not very clear to understand
The text was updated successfully, but these errors were encountered: