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

Keras backend functionality changed? #14248

Closed
al3xsh opened this issue Nov 4, 2017 · 9 comments
Closed

Keras backend functionality changed? #14248

al3xsh opened this issue Nov 4, 2017 · 9 comments

Comments

@al3xsh
Copy link

al3xsh commented Nov 4, 2017

Hi,

I have been using keras from within tensorflow since it was included into the contrib package - but it seems that in the 1.4 release the keras backend is missing some functionality ...

For example:

>> from tensorflow.python.keras import backend as K
>> K.tile
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'tile'

Whereas in tensorflow 1.1:

>>> from tensorflow.contrib.keras.python.keras import backend as K
>>> K.tile
<function tile at 0x7fbd9024fb70>

And using pure keras:

>>> from keras import backend as K
Using TensorFlow backend.

>>> K.tile
<function tile at 0x7fe9743c5950>

Is this just an omission, or has the functionality been deliberately removed? I know I can use the equivalent tensorflow operation - but it's nice to be able to use a reasonably portable api and if I wanted to switch backend I could just change the import path. I also try not too mix keras and tensorflow too much as I think the code is more readable just using one!

Regards,

Alex

@al3xsh al3xsh changed the title Keras backend Keras backend functionality changed? Nov 4, 2017
@bignamehyp bignamehyp added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Nov 7, 2017
@bignamehyp
Copy link
Member

@fchollet any reason tile not included in tensorflow/python/keras/backend/init.py?

@fchollet
Copy link
Member

fchollet commented Nov 7, 2017

Thanks for reporting this, it seems like it was omitted from the list of symbols that are part of the public API. We'll fix it in the next release.

Have you noticed this for any other symbol than tile?

@al3xsh
Copy link
Author

al3xsh commented Nov 7, 2017

Hi @fchollet - thanks for the quick response!

Aside from tile, the following are missing:
conv3d_transpose
cumprod
cumsum
depthwise_conv2d
identity
local_conv1d
local_conv2d
logsumexp

I have added these imports into init.py and created a pull request.

#14318

Regards,

Alex

@ahundt
Copy link
Contributor

ahundt commented Dec 10, 2017

@fchollet Could the tf keras and backend import become simpler for the next release?

Perhaps:
import tf.keras and from tf.keras import backend as K

Any reasonable and easy to use option would be fantastic! If nothing else better documentation of the current preferred way to import keras and the backend would also be helpful.

@tensorflowbutler
Copy link
Member

It has been 14 days with no activity and the awaiting tensorflower label was assigned. Please update the label and/or status accordingly.

@abhijitghosh2
Copy link

According to your Python or Anaconda version ....install perfect version of tensorflow and keras otherwise it will give error.

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jan 23, 2018
@tensorflowbutler
Copy link
Member

A member of the TensorFlow organization has replied after the stat:awaiting tensorflower label was applied.

@drpngx
Copy link
Contributor

drpngx commented Jan 31, 2018

Closing since it looks like the issue was resolved. Feel free to reopen.

@drpngx drpngx closed this as completed Jan 31, 2018
@kesinger
Copy link

I've run into this using tf1.13.1 and 1.12 (not sure minor version) on osx:

import tensorflow.keras.backend as K
'cumsum' in dir(K) # False

On ubuntu, it's present in 1.13.0-dev20190208 but not in 1.12.0

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

8 participants