Error with Keras 2.4.2 and 2.4.3
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
What is your tensorflow version?
2.2.0
Thanks, I will look into this.
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.
@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.
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.
Updated the readme to reflect these requirements. @skt7 Thank you for the suggestion.
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'"