deepgram / kur

Descriptive Deep Learning
Apache License 2.0
814 stars 107 forks source link

AttributeError: module 'keras.backend' has no attribute 'set_image_dim_ordering' #106

Open chrisspen opened 4 years ago

chrisspen commented 4 years ago

Running one of the example files:

 kur -v train speech.yml

returns the error:

Traceback (most recent call last):
  File "~/myproject/env/bin/kur", line 8, in <module>
    sys.exit(main())
  File "~/myproject/env/lib/python3.7/site-packages/kur/__main__.py", line 492, in main
    sys.exit(args.func(args) or 0)
  File "~/myproject/env/lib/python3.7/site-packages/kur/__main__.py", line 63, in train
    func = spec.get_training_function()
  File "~/myproject/env/lib/python3.7/site-packages/kur/kurfile.py", line 392, in get_training_function
    model = self.get_model(provider)
  File "~/myproject/env/lib/python3.7/site-packages/kur/kurfile.py", line 173, in get_model
    backend=self.get_backend(),
  File "~/myproject/env/lib/python3.7/site-packages/kur/kurfile.py", line 200, in get_backend
    (self.data.get('settings') or {}).get('backend')
  File "~/myproject/env/lib/python3.7/site-packages/kur/backend/backend.py", line 285, in from_specification
    result = target(**params)
  File "~/myproject/env/lib/python3.7/site-packages/kur/backend/keras_backend.py", line 195, in __init__
    keras.backend.set_image_dim_ordering('tf')
AttributeError: module 'keras.backend' has no attribute 'set_image_dim_ordering'

I'm using Python 3.7 and tensorflow (cpu) and tensorflow==2.0.0. I've seen similar errors before in other projects, and it's usually due to incompatible versions, since tensorflow 2.0.0 introduced a lot of backwards incompatible changes. Can I assume Kur doesn't yet support Tensorflow 2.0.0? If so, which version of Tensorflow is supported? Neither the README nor setup.py specify the compatible version numbers.

askinucuncu commented 3 years ago

open editor --> /myproject/env/lib/python3.7/site-packages/kur/backend/keras_backend.py -->line 195 -->keras.backend.set_image_dim_ordering('tf') change keras.backend.set_image_data_format('channels_last')

save file and run -> kur -v train speech.yml