-
Notifications
You must be signed in to change notification settings - Fork 618
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
sweep: Parameter value written w/ scientific notation gets converted to str? #1129
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
FTR, in the same
|
Thanks for reporting @EricCousineau-TRI we're digging into the root cause. |
Hey @EricCousineau-TRI |
This problem still exists with version: 0.10.18 |
Aye, confirmed. Updated min-repro above @ariG23498 Can we re-open this? |
The root cause is indeed as @EricCousineau-TRI said can be PyYAML. Here is a link from stackoverflow addressing an workaround: https://stackoverflow.com/questions/30458977/yaml-loads-5e-6-as-string-and-not-a-number |
From above, it seems that there is still a PR lingering for this builtin
FWIW In my code, I simply just hack around it. I'm using def _maybe_convert(value, T):
try:
return T(value)
except ValueError:
return value
def _reconcile(value, T):
...
assert isinstance(T, type), (T, value)
if T == float:
if isinstance(value, str):
# Workaround:
# https://github.com/wandb/client/issues/1129
# https://github.com/yaml/pyyaml/issues/173
value = _maybe_convert(value, float)
assert isinstance(value, (float, int)), (T, value)
... |
My suggested workaround for Rationale: See this comment: yaml/pyyaml#173 (comment)
|
wandb --version && python --version && uname
Description
I get the following error when attempting to launch a local sweep:
What I Did
I wrote a
sweep.yaml
file, following the documentation:https://docs.wandb.com/sweeps/configuration#parameters
I launched as described above, but got the above error. When editing the code, I found that one of the parameters was getting converted to a string.
Reproduction:
Guesses
Something is randomly trying to stringify things?
The text was updated successfully, but these errors were encountered: