question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: rate must be a scalar tensor or a float in the range [0, 1), got 1 with DeepID model

See original GitHub issue

When trying to use DeepID model, I’m getting an error (while all other models work as expected).

OS: Windows 10 Python: 3.7 Tensorflow: 2.2.0 Keras: 2.4.3

Error details below:

File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\deepface\DeepFace.py", line 221, in verify model = DeepID.loadModel() File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\deepface\basemodels\DeepID.py", line 17, in loadModel x = Dropout(rate=1, name='D1')(x) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 922, in __call__ outputs = call_fn(cast_inputs, *args, **kwargs) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\layers\core.py", line 211, in call lambda: array_ops.identity(inputs)) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\utils\tf_utils.py", line 65, in smart_cond pred, true_fn=true_fn, false_fn=false_fn, name=name) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\smart_cond.py", line 59, in smart_cond name=name) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 1177, in cond return cond_v2.cond_v2(pred, true_fn, false_fn, name) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\ops\cond_v2.py", line 84, in cond_v2 op_return_value=pred) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\func_graph.py", line 981, in func_graph_from_py_func func_outputs = python_func(*func_args, **func_kwargs) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\layers\core.py", line 207, in dropped_inputs rate=self.rate) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 4343, in dropout return dropout_v2(x, rate, noise_shape=noise_shape, seed=seed, name=name) File "..\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 4423, in dropout_v2 "range [0, 1), got %g" % rate) ValueError: rate must be a scalar tensor or a float in the range [0, 1), got 1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
serengilcommented, Dec 13, 2020

deepface now is compatible with tf 2. you can test it.

1reaction
serengilcommented, Oct 29, 2020

you can run the following commands respectively

pip install tensorflow==1.9.0
pip install keras==2.2.0
pip install deepface
Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: rate must be a scalar tensor or a float in the range ...
... model it stops in the validation steps showing the error: ValueError: rate must be a scalar tensor or a float in the...
Read more >
Keras NLP TransformerDecoder MultiHeadAttention Value Error
Everything was fine until eventually needed to batch my input dataset to get around GPU memory limitations. Now I encountered this error:
Read more >
Recent Developments in Deep Learning for Engineering ...
Table 1: Important milestones in the history of neural networks and machine learning, leading up to the era of deep learning.
Read more >
deepid tensorflow - CSDN
Window10 Cuda9.0 Python3.6 Pycharm + Anaconda. 主要依赖 keras-gpu 2.24 tensorflow-gpu 1.12.0 opencv 3.3.1 pillow 6.2.1 numpy scipy pyyaml sklearn ...
Read more >
Trying to change graph regression model for pair of graphs to ...
I'm trying to adapt this code that currently works for regression to work for classification but I get multiple errors, thought it would...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found