Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

error with crf layer #559

Open
yassmine-lam opened this issue Jun 15, 2021 · 1 comment
Open

error with crf layer #559

yassmine-lam opened this issue Jun 15, 2021 · 1 comment

Comments

@yassmine-lam
Copy link

hi,

I got this error when trying to use the crf layer from keras_contrib

AttributeError: module 'tensorflow.keras.backend' has no attribute 'slice'

Could someone help plz

thank u

@IS5882
Copy link

IS5882 commented Jun 26, 2021

Hi Yassmine, I was able to solve it, by using an older version of tensor flow and keras try that

!pip uninstall tensorflow -y
!pip install tensorflow==2.2.0

!pip install git+https://www.github.com/keras-team/keras-contrib.git
from keras_contrib.layers import CRF

from subprocess import check_output

from subprocess import check_output

but you will still get errors, open the file in lib (that has the errors) and add those
import tensorflow.compat.v1 as tf

tf.disable_v2_behavior()

tf.compat.v1.train.Optimizer
I think its called tensorflow.py

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

2 participants