martinzlocha/anchor-optimization

AttributeError: module 'keras.utils' has no attribute 'Sequence'

alancarlosml opened this issue · 2 comments

Hi,
I'm getting this error messagem when runing:

$ python anchor_optimization\optimize_anchors.py test.csv

Traceback (most recent call last):
  File "E:\anchor-optimization\anchor_optimization\optimize_anchors.py", line 11, in <module>
    from keras_retinanet.preprocessing.csv_generator import _open_for_csv
  File "C:\Users\USER\anaconda3\envs\keras_env\lib\site-packages\keras_retinanet\preprocessing\csv_generator.py", line 18, in <module>
    from .generator import Generator
  File "C:\Users\USER\anaconda3\envs\keras_env\lib\site-packages\keras_retinanet\preprocessing\generator.py", line 39, in <module>
    class Generator(keras.utils.Sequence):
AttributeError: module 'keras.utils' has no attribute 'Sequence'

Tensorflow version: 2.7.0

Any help?

Same problem with you

kirnh commented

Changing Generator(keras.utils.Sequence) to Generator(keras.utils.all_utils.Sequence) should fix this.