sweep: Parameter value written w/ scientific notation gets converted to str?
See original GitHub issuewandb --version && python --version && uname
- Weights and Biases version: wandb, version 0.9.1
- Python version: Python 3.6.9
- Operating System: Linux (Ubuntu 18.04)
Description
I get the following error when attempting to launch a local sweep:
$ wandb sweep --controller ./sweep.yaml
...
File ".../lib/python3.6/site-packages/wandb/sweeps/params.py", line
118, in __init__
if self.min >= self.max:
TypeError: '>=' not supported between instances of 'str' and 'float'
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:
( set -eux;
cd $(mktemp -d)
python3 -m venv .
source ./bin/activate
cat > requirements.txt <<'EOF'
wandb==0.10.18
numpy==1.19.0
scipy==1.5.0
EOF
pip install -r ./requirements.txt
cat > ./script.py <<'EOF'
import os
import wandb
def main():
os.environ["WANDB_MODE"] = "dryrun"
config = dict(
lr=1e-4,
)
wandb.init(
config=config,
)
print(wandb.config)
if __name__ == "__main__":
main()
EOF
cat > ./sweep.yaml <<'EOF'
program: ./script.py
controller:
type: local
method: bayes
metric:
name: loss/train
goal: minimize
parameters:
lr:
distribution: uniform
min: 1.e-5 # This is the problem.
max: 0.001
command:
- ${env}
- ${interpreter}
- ${program}
- ${args}
EOF
wandb sweep --controller ./sweep.yaml
)
Guesses
Something is randomly trying to stringify things?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
sweep: Parameter value written w/ scientific notation gets ...
When editing the code, I found that one of the parameters was getting converted to a string. Reproduction: ( set -eux; cd $(mktemp...
Read more >Convert Scientific Notation to String - python - Stack Overflow
When I load xlsx file. I have a number IBAN with scientific notation. For example: 7.810500161524 ...
Read more >TOPCAT - Tool for OPerations on Catalogues And Tables
If all the fields in one column can be parsed as integers (or null values), then that column will turn into an integer-type...
Read more >Reverse Polish Notation - SDK Documentation
Here is a full example of how Reverse Polish Notation is used along with the available parameters and operands within the XML for...
Read more >std::scientific - CPlusPlus.com
When floatfield is set to scientific , floating-point values are written using scientific notation: the value is represented always with only one digit ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This problem still exists with version: 0.10.18
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