Closed dohtem81 closed 4 years ago
I'm having the same issue with python3.8.
having same issue with python 3.7 keras=2.4.2 and tensorflow=2.2.0
having same issue with python 3.7 keras=2.4.3 and tensorflow=2.2.0
I had the same problem. Turns out that 8 days ago Keras updated to version 2.4 with a note saying that some workflows may break. I rolled back to keras 2.3.1 and everything worked again:
pip3 install keras==2.3.1
Thanks @eeilerts, that solved it for me!
Looks like this fixed my problem also. Thanks!
On Jun 25, 2020, at 9:00 PM, ptdw notifications@github.com wrote:
Thanks @eeilerts https://github.com/eeilerts, that solved it for me!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fizyr/keras-retinanet/issues/1395#issuecomment-649906366, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACETMVYEJ4EXQAO4GFPBNBLRYP6MFANCNFSM4OFIG2VQ.
Hello, I have the same problem, I replaced all imports by tf.keras (version id 2.3.0-tf) Are tf.keras and keras incompatible ? Thank you
No. All is the same. Just use Keras 2.3.1 instead of latest. I got caught by that because I started to work on something, got a new laptop and when moving source I did not think that Keras version between laptops is not the same. Shame on me ;)
On Tue, Jul 7, 2020 at 7:50 AM Louis Ulmer notifications@github.com wrote:
Hello, I have the same problem, I replaced all imports by tf.keras (version id 2.3.0-tf) Are tf.keras and keras incompatible ? Thank you
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fizyr/keras-retinanet/issues/1395#issuecomment-654834309, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACETMV7WRM2CTAKC45I54RTR2MKZTANCNFSM4OFIG2VQ .
Downgrading Keras to 2.3.1 works.
Indeed, downgrading keras to 2.3.1 works for me as well. Thanks
is it worth pinning setup.py to Keras 2.3.1? (This is what I have now done as a temporary hotfix on private fork). Otherwise, seems there is a good bit of work to do to get various things compatible with 2.4
What is the issue with 2.4?
Cannot load model. Looks like this is the final effect but the root cause seems to be in new Keras. TypeError: Cannot interpret 'tf.float32' as a data type
On Thu, Jul 23, 2020 at 2:03 AM Hans Gaiser notifications@github.com wrote:
What is the issue with 2.4?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fizyr/keras-retinanet/issues/1395#issuecomment-662850771, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACETMV2PXACT7J4WTTR6BSDR47OFVANCNFSM4OFIG2VQ .
Hi, I have a similar issue. I'm using Google Colab, Python 3.6.9, tensorflow 2.2
TypeError Traceback (most recent call last)
<ipython-input-3-7ddd8b74fd4e> in <module>()
5 # load retinanet model
6 model_path = os.path.join( 'snapshots', 'resnet50_coco_best_v2.1.0.h5')
----> 7 model = models.load_model(model_path, backbone_name='resnet50')
8
9 # if the model is not converted to an inference model, use the line below
31 frames
/usr/local/lib/python3.6/dist-packages/numpy/core/numeric.py in ones(shape, dtype, order)
205
206 """
--> 207 a = empty(shape, dtype, order)
208 multiarray.copyto(a, 1, casting='unsafe')
209 return a
TypeError: data type not understood
after changing Keras from 2.4.3
to 2.3.1
I get following error
AttributeError Traceback (most recent call last)
<ipython-input-6-7ddd8b74fd4e> in <module>()
5 # load retinanet model
6 model_path = os.path.join( 'snapshots', 'resnet50_coco_best_v2.1.0.h5')
----> 7 model = models.load_model(model_path, backbone_name='resnet50')
8
9 # if the model is not converted to an inference model, use the line below
/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py in is_tensor(x)
701
702 def is_tensor(x):
--> 703 return isinstance(x, tf_ops._TensorLike) or tf_ops.is_dense_tensor
704
705
AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'
Seems that Colab has changed the versions of Keras and TF. This problems are solved downgrading Keras and TF to versions Keras=2.3.1 and TF=2.1. Using newer versions of Keras and Tensorflow make this problem appear. Hope it helps.
Seems that Colab has changed the versions of Keras and TF. This problem does not appear versions Keras 2.3.1, and TF=2.1. I tested in newer versions of Keras and Tensorflow, and the problem persist. Hope it helps
I have tested with keras 2.3.1 and tf 2.2 in Colab and does not work. I changed the versions in requirements.txt file and run it.
Seems that Colab has changed the versions of Keras and TF. This problem does not appear versions Keras 2.3.1, and TF=2.1. I tested in newer versions of Keras and Tensorflow, and the problem persist. Hope it helps
I have tested with keras 2.3.1 and tf 2.2 in Colab and does not work. I changed the versions in requirements.txt file and run it.
Try downgrading Tf=2.1, it solved this problem to me. i changed my original comment to make it more understandable :)
Thank you @jhoncc2 . Colab works with new tensorflow versions. Now the code works!
Seems that Colab has changed the versions of Keras and TF. This problem does not appear versions Keras 2.3.1, and TF=2.1. I tested in newer versions of Keras and Tensorflow, and the problem persist. Hope it helps
I have tested with keras 2.3.1 and tf 2.2 in Colab and does not work. I changed the versions in requirements.txt file and run it.
Try downgrading Tf=2.1, it solved this problem to me. i changed my original comment to make it more understandable :)
thanks alot @jhoncc2
This issue has been automatically marked as stale due to the lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Running on MacOS, Docker Desktop 2.3.0.3, python:3.7 image. Installed all dependencies. When loading model resnet50_coco_best_v2.1.0.h5 following log ends up with error
Code pretty straightforward:
from keras_retinanet.models import load_model model = load_model('./models/resnet50_coco_best_v2.1.0.h5', backbone_name='resnet50')