fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.38k stars 1.96k forks source link

binary incompatibility in compute_overlap #1546

Closed stvogel closed 2 years ago

stvogel commented 3 years ago

I wanted to run retinanet inside a docker. Therefore I installed keras-retinanet with pip install (version 1.0.0). But importing keras_retinanet yields this error:

  File "/opt/conda/lib/python3.8/site-packages/keras_retinanet/models/__init__.py", line 87, in load_model
    return keras.models.load_model(filepath, custom_objects=backbone(backbone_name).custom_objects)
  File "/opt/conda/lib/python3.8/site-packages/keras_retinanet/models/__init__.py", line 57, in backbone
    from .resnet import ResNetBackbone as b
  File "/opt/conda/lib/python3.8/site-packages/keras_retinanet/models/resnet.py", line 21, in <module>
    from . import retinanet
  File "/opt/conda/lib/python3.8/site-packages/keras_retinanet/models/retinanet.py", line 19, in <module>
    from .. import layers
  File "/opt/conda/lib/python3.8/site-packages/keras_retinanet/layers/__init__.py", line 1, in <module>
    from ._misc import RegressBoxes, UpsampleLike, Anchors, ClipBoxes  # noqa: F401
  File "/opt/conda/lib/python3.8/site-packages/keras_retinanet/layers/_misc.py", line 20, in <module>
    from ..utils import anchors as utils_anchors
  File "/opt/conda/lib/python3.8/site-packages/keras_retinanet/utils/anchors.py", line 20, in <module>
    from ..utils.compute_overlap import compute_overlap
  File "keras_retinanet/utils/compute_overlap.pyx", line 1, in init keras_retinanet.utils.compute_overlap
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

I installed numpy 1.18.5, but also tried with other numpy-versions < 1.19 (I'm using tensorflow 2.3.0 and keras 2.4.3). I see there is the compute_overlap.cpython-38-x86_64-linux-gnu.so installed (by the way, I also tried python 37 with the same error) and this does somehow not fit my environment.

Which incompatibility do I have to solve?

Nitschi commented 3 years ago

I have the same issue. My installed packages are the following:

absl-py==0.14.1
astunparse==1.6.3
cachetools==4.2.4                                                                                                                 
certifi==2020.6.20
charset-normalizer==2.0.6
Cython==0.29.24
gast==0.3.3
google-auth==1.35.0
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.41.0
h5py==2.10.0
idna==3.2
Keras==2.4.3
Keras-Preprocessing==1.1.2
keras-resnet==0.2.0
keras-retinanet==1.0.0
Markdown==3.3.4
numpy==1.18.5
oauthlib==3.1.1
opencv-python==4.5.3.56
opt-einsum==3.3.0
Pillow==8.3.2
progressbar2==3.53.3
protobuf==3.18.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
python-utils==2.5.6
PyYAML==5.4.1
requests==2.26.0
requests-oauthlib==1.3.0
rsa==4.7.2
scipy==1.7.1
six==1.16.0
tensorboard==2.6.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.3.1
tensorflow-estimator==2.3.0
termcolor==1.1.0
urllib3==1.26.7
Werkzeug==2.0.1
wrapt==1.13.1
stale[bot] commented 2 years ago

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.

satpalsr commented 1 year ago

Solved with numpy upgrade