suggest_discrete_uniform error "unsupported operand type(s) for *: 'int' and 'NoneType'"
See original GitHub issueConditions
-
Optuna version: 0.14.0
-
Python version: 3.6.8
-
OS: Google Colab
-
Machine Learning library to be optimized: TensorFlow 2.0.0-beta1
Code to reproduce
The error started during a study run on Google Colab. I don’t have a min repro but can share the model sqlite DB and model code if needed.
Error messages, stack traces, or logs
[W 2019-08-05 19:12:03,795] Setting status of trial#27 as TrialState.FAIL because of the following error: TypeError("unsupported operand type(s) for *: 'int' and 'NoneType'",)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/optuna/study.py", line 469, in _run_trial
result = func(trial)
File "<ipython-input-42-176311fa1b08>", line 33, in objective
model = make_trial_model(trial, input_shape)
File "<ipython-input-17-3a5c1667bd48>", line 37, in make_trial_model
embedding_size = trial.suggest_discrete_uniform('embedding_size', 100, 300, 50)
File "/usr/local/lib/python3.6/dist-packages/optuna/trial.py", line 268, in suggest_discrete_uniform
return self._suggest(name, distribution)
File "/usr/local/lib/python3.6/dist-packages/optuna/trial.py", line 455, in _suggest
study, trial, name, distribution)
File "/usr/local/lib/python3.6/dist-packages/optuna/samplers/tpe/sampler.py", line 94, in sample_independent
values, scores = _get_observation_pairs(study, param_name)
File "/usr/local/lib/python3.6/dist-packages/optuna/samplers/tpe/sampler.py", line 523, in _get_observation_pairs
score = (-step, sign * intermediate_value)
TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Python Error: unsupported operand type(s) for +: 'int' and ...
Whenever you see an error that include 'NoneType' that means that you have an operand or an object that is None when you...
Read more >Unsupported operand type(s) for +: 'NoneType' and 'int'
The Python "TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'" occurs when we try to use the addition (+) operator with a ......
Read more >unsupported operand type(s) for +: 'NoneType' and 'int'
In python, TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' error occurs when an integer value is added to a variable that...
Read more >unsupported operand type(s) for +=: 'int' and 'NoneType ...
Hey Can someone please explain why i ping this error when returning the 'elif' part of the statement. Other research has helped me...
Read more >TypeError: unsupported operand type(s) for |: 'type ... - GitHub
TypeError : unsupported operand type(s) for |: 'type' and 'NoneType' #371. Open.
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 Free
Top 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

I’ve run several studies with 0.14.0 using new DBs and I haven’t seen the problem again.
Will do.