textClassifier icon indicating copy to clipboard operation
textClassifier copied to clipboard

y_permute_dim.pop(-2) pop index out of range

Open imgoodman opened this issue 6 years ago • 5 comments

hi, this is an awesome implementation. However, when I use AttLayer, I got an IndexError: pop index out of range. It is found in eij = K.tanh(K.dot(x, self.W)). Then, y_permute_dim =[y_permute_dim.pop(-2)] + y_permute_dim. my keras is 2.1.5. Thanks a lot

imgoodman avatar Aug 01 '18 08:08 imgoodman

I have same problems in "eij = K.tanh(K.dot(x, self.W))", it says IndexError: pop index out of range, my keras is 1.2.2, can you tell me what's going on?

blog4me avatar Sep 03 '18 13:09 blog4me

same problem

tianke0711 avatar Sep 20 '18 01:09 tianke0711

same problem

tensor-flower avatar Oct 18 '18 09:10 tensor-flower

I have encountered the same problem now, how did you solve it?

DingYunxia avatar Nov 15 '18 02:11 DingYunxia

@imgoodman @DingYunxia You can switch Keras backend to Theano. This might be helpful to change the backend of Keras

import keras.backend as K
import importlib
import os


def change_keras_backend(backend):
    if K.backend() != backend:
        os.environ['KERAS_BACKEND'] = backend
        importlib.reload(K)


change_keras_backend("theano")

prabhatkgupta avatar Dec 24 '20 08:12 prabhatkgupta