ValueError: rate must be a scalar tensor or a float in the range [0, 1), got 1 with DeepID model
See original GitHub issueWhen 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:
- Created 3 years ago
- Comments:6 (4 by maintainers)
deepface now is compatible with tf 2. you can test it.
you can run the following commands respectively