tensorflow / tensorflow/probability
AttributeError: 'float' object has no attribute 'dtype' When executing tfp.optimizer.differential_evolution_one_step, but not during tfp.optimizer.differential_evolution_minimize
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
When running
tfp.optimizer.differential_evolution_one_step, I am receiving the error:
AttributeError: 'float' object has no attribute 'dtype'
line 196, in one_step
seed=seed_stream())
File "/<path_to_tensorflow>/differential_evolution.py", line 665, in _binary_crossover
dtype=crossover_prob.dtype.base_dtype,
AttributeError: 'float' object has no attribute 'dtype'
However, when using tfp.optimizer.differential_evolution_minimize(), the code works as intended, making me think that it is potentially an issue with TFP. I am currently running Tensorflow 2.0 and TFP version 0.8.0.
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with TensorFlow 2.0 and TFP 0.8.0 using differential_evolution_one_step, then inspect differential_evolution.py around one_step and _binary_crossover at line 665. Compare its handling with differential_evolution_minimize; done means one_step no longer raises the reported AttributeError for the same inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100