richliao / textClassifier

Text classifier for Hierarchical Attention Networks for Document Classification
Apache License 2.0
1.07k stars 379 forks source link

AttLayer has no attribute init #4

Open andreaskoelsch opened 7 years ago

andreaskoelsch commented 7 years ago

Hi, When I am using your code, this is the error that I get:

    l_att = AttLayer()(l_dense)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 491, in __call__
    self.build(input_shapes[0])
  File "text_ClassifierHATT.py", line 222, in build
    self.W = self.init((input_shape[-1],))
AttributeError: 'AttLayer' object has no attribute 'init'
richliao commented 7 years ago

Keras layer interface probably has changed. You need to adapt to the new protocol. Check Keras topology.py file.

vikas95 commented 7 years ago

@koelscha - could you solve this problem?? Even I am getting the same error. @richliao - Can you help us by pointing out at a specific function (or line number) in Keras topology.py file. https://github.com/fchollet/keras/blob/master/keras/engine/topology.py

Thanks guys..