Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Error with Keras 2.4.2 and 2.4.3 #33

Open
adrien-jacquot opened this issue Jun 25, 2020 · 8 comments
Open

Error with Keras 2.4.2 and 2.4.3 #33

adrien-jacquot opened this issue Jun 25, 2020 · 8 comments
Assignees

Comments

@adrien-jacquot
Copy link

adrien-jacquot commented Jun 25, 2020

Hello!

I got an "automatic" update of Keras from 2.3.1 to 2.4.3 (I'm using pipenv, and Keras was set to "*" in the Pipfile).
My code won't run anymore with Keras 2.4.3, I'm getting the error below at runtime.
No issue with 2.3.1 though.

(I don't mind using Keras 2.3.1 so not really a blocking issue, just thought you'd wanted to know.)

Traceback (most recent call last): File "xxx/main.py", line 23, in <module> segmenter = DeepSegment('fr')
m = K.slice(states[3], [0, t], [-1, 2]) AttributeError: module 'keras.backend' has no attribute 'slice'
I also have an error with Keras 2.4.2:
Exception occured: in user code:
/xxx/lib/python3.8/site-packages/tensorflow/python/keras/utils/tf_utils.py:140 get_reachable_from_inputs raise TypeError('Expected Operation, Variable, or Tensor, got ' + str(x)) TypeError: Expected Operation, Variable, or Tensor, got 0

@adrien-jacquot adrien-jacquot changed the title Error with Keras 2.4.3 Error with Keras 2.4.2 and 2.4.3 Jun 25, 2020
@bedapudi6788
Copy link
Collaborator

What is your tensorflow version?

@adrien-jacquot
Copy link
Author

2.2.0

@bedapudi6788
Copy link
Collaborator

Thanks, I will look into this.

@bedapudi6788 bedapudi6788 self-assigned this Jun 26, 2020
@skt7
Copy link

skt7 commented Aug 16, 2020

I am facing the same issue. As far as I understand the issue is with the keras compatibility of the tensorflow backend.

I am using the following versions -
keras==2.4.3
tensorflow==2.3.0

Can you please help with versions you used with the build. Maybe changing to the same will resolve the issue.

@bedapudi6788
Copy link
Collaborator

@skt7 I generally use with tf==1.14 and keras==2.2.4. It should work with tf 2.2 and keras 2.3 too as mentioned by the original poster on this issue.

@skt7
Copy link

skt7 commented Aug 17, 2020

Thanks @bedapudi6788, it worked with -
keras==2.3.1
tensorflow==2.2.0

Also for tensorflow 1, it works fine with the versions -
keras==2.2.4
tensorflow==1.14.0

Few Suggestions -

  • I think the original issue is with regards to compatibility issues with keras and tensorflow and not with deepsegment. You can redirect to the same and maybe close this issue.
  • You can mention the supported versions in the readme to avoid future conflicts for new users.

@bedapudi6788
Copy link
Collaborator

Updated the readme to reflect these requirements. @skt7 Thank you for the suggestion.

@shantanubinra
Copy link

I tried using DeepSegment In Colab ,but it showing error at line "segmenter = DeepSegment('en')"
with error stating ;
"module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'"

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

No branches or pull requests

4 participants