Giter VIP home page Giter VIP logo

Comments (9)

philipperemy avatar philipperemy commented on July 24, 2024

@Love-world are you using the Theano backend?

I suggest you to use the Tensorflow backend! I haven't tested it with Theano

from keras-attention.

Love-world avatar Love-world commented on July 24, 2024

Yes, I use the Theano backend.
It works with the Tensorflow backend.
Thank you very much.

from keras-attention.

sun-peach avatar sun-peach commented on July 24, 2024

Hi, dear all,

Even though I changed to Tensorflow backend, I still have issue:
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/fei.t/Tools/attention-model/attention_lstm.py", line 59, in
m = model_attention_applied_before_lstm()
File "/home/fei.t/Tools/attention-model/attention_lstm.py", line 42, in model_attention_applied_before_lstm
attention_mul = attention_3d_block(inputs)
File "/home/fei.t/Tools/attention-model/attention_lstm.py", line 20, in attention_3d_block
a = Dense(TIME_STEPS, activation='softmax')(a)
File "/home/fei.t/anaconda2/envs/fei/lib/python2.7/site-packages/keras/engine/topology.py", line 470, in call
self.assert_input_compatibility(x)
File "/home/fei.t/anaconda2/envs/fei/lib/python2.7/site-packages/keras/engine/topology.py", line 411, in assert_input_compatibility
str(K.ndim(x)))
Exception: Input 0 is incompatible with layer dense_1: expected ndim=2, found ndim=3

Does anyone know how to fix this? Thank you.

from keras-attention.

philipperemy avatar philipperemy commented on July 24, 2024
[10:15:25 - 17-06-24] /Users/philipperemy % python3
Python 3.5.2 (default, Jun 29 2016, 13:43:58)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras
Using TensorFlow backend.
>>> keras.__version__
'2.0.2'
>>> import tensorflow
>>> tensorflow.__version__
'1.2.0'

what do you have?

from keras-attention.

sun-peach avatar sun-peach commented on July 24, 2024

same version, but I use python 2.7

from keras-attention.

philipperemy avatar philipperemy commented on July 24, 2024

When you say same version, do you mean you have both Keras 2.0.2 and Tensorfow 1.2.0?

from keras-attention.

philipperemy avatar philipperemy commented on July 24, 2024

Can you print the full output when you run the script too. Thanks

from keras-attention.

sun-peach avatar sun-peach commented on July 24, 2024

Hi, Philip,

It seems my tensorflow has low version 1.0.0. I think this is the problem. Thank you.

from keras-attention.

philipperemy avatar philipperemy commented on July 24, 2024

Ok great!

from keras-attention.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.