Open woodserino opened 4 years ago
I have the same problem. How to solve it?
This error is caused due to the fact that TensorFlow/Keras have changed their APIs slightly since initially releasing this module.
I've removed/changed the offending lines of code, and fixed the specific versions of TensorFlow and Keras used, so this should now resolve the issue.
Please let me know if this has resolved the issue for you. To update to the latest release:
pip install --upgrade face-compare
Thanks for reactive solving problem. I'll try new version later today
This issue fixed But I got new problem: _tensorflow.python.framework.errorsimpl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU
I have installed intel-tensorflow, but it have no any effect
My configuration: Windows 10 Intel Core i5-6500 Nvidia GTX 1060 6GB (without installed CUDA)
This issue fixed But I got new problem: _tensorflow.python.framework.errorsimpl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU
Yes, I encountered this problem too. NHWC
refers to the order in which the data is stored so Number x Height x Width x Channels. As it turns out this model is trained on data that is in NCHW
format or Number x Channels x Height x Width. The reason you get the error is that NCHW
is not natively supported for the CPU implementation of TensorFlow. I believe that if you had CUDA configured that this wouldn't be an issue.
This problem can be fixed however by installing the Intel optimization for TensorFlow via
pip install intel-tensorflow
More information for which can be found here. I've also added this as a known issue to the README.md
page.
Hope this helps.
Yes, I have installed intel-tensorflow, but error remained
Hmm, my only suggestion would be to see if any of the other installation options on the intel optimization for tensorflow page work.
Using the intel-tensorflow
in Windows 10 Ubuntu Subshell worked for me.
Since you have an NVIDIA graphics card, is installing CUDA an option for you?
I can help you, the TF2 has already delete the module of set_session, i give your a example
this is wrong
from keras import backend as K tf_session = tf.compat.v1.Session(graph=tf.compat.v1.get_default_graph(),config=config) K.set_session(tf_session)
and the complie shew that AttributeError: module 'keras.backend' has no attribute 'set_session'
you can fix it by follows
tf_session = tf.compat.v1.Session(graph=tf.compat.v1.get_default_graph(),config=config) tf.compat.v1.keras.backend.set_session(tf_session)
Hello Team,
Please help me in resolving the issue.
Python: 3.10.6 Pip: 22.0.2 Tensorflow: 2.11.0 Keras: 2.11.0
Error:
Traceback (most recent call last):
File "/usr/local/bin/compare_faces.py", line 8, in
tf_session
where is this file we need to check? i have this problem
https://github.com/m-lyon/face-comparison/issues/5#issuecomment-1526143778
Hmm, my only suggestion would be to see if any of the other installation options on the intel optimization for tensorflow page work.
Using the
intel-tensorflow
in Windows 10 Ubuntu Subshell worked for me.Since you have an NVIDIA graphics card, is installing CUDA an option for you?
i have nvidia and CUDA installed still not working
Are you sure CUDA is enabled and visible to tensorflow? you can check via tf.config.list_physical_devices('GPU')
I'm getting the following error:
ModuleNotFoundError: No module named 'keras.backend.tensorflow_backend'; 'keras.backend' is not a package
when I try to run facecompare. So far I've tried changing keras and TF versions (as per https://stackoverflow.com/questions/58047454/how-to-fix-module-keras-backend-tensorflow-backend-has-no-attribute-is-tf) but I haven't found a solution that works yet.
Using tensorflow 2.3.0, keras 2.4.3 and python 3.8.5