Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chrisspen opened this issue Nov 14, 2019 · 1 comment

Comments

@chrisspen
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants