Coder Social home page Coder Social logo

Comments (5)

vidzrox avatar vidzrox commented on July 18, 2024 5

It should be written as "keep_dims=True"

from capsnet-tensorflow.

ZhiboRao avatar ZhiboRao commented on July 18, 2024

I have met the same question.

from capsnet-tensorflow.

ZhiboRao avatar ZhiboRao commented on July 18, 2024

I find you can fix the capsLayer.py. In 129, you delete the "keepdims=True".
Then it works.

from capsnet-tensorflow.

pulins201 avatar pulins201 commented on July 18, 2024

ok

from capsnet-tensorflow.

sks4world avatar sks4world commented on July 18, 2024

I'm getting the same error when following this github code
https://github.com/akosiorek/akosiorek.github.io/blob/master/notebooks/attention_glimpse.ipynb How can I fix this? I'm stuck

Jupyter notebook:

Gaussian Attention

gaussian_att_params = tf.concat([tu, ts, td, tu, ts, td], -1)
gaussian_glimpse_expr = gaussian_glimpse(tx, gaussian_att_params, glimpse_size)

Upon running error:
TypeError Traceback (most recent call last)
in
1 # Gaussian Attention
2 gaussian_att_params = tf.concat([tu, ts, td, tu, ts, td], -1)
----> 3 gaussian_glimpse_expr = gaussian_glimpse(tx, gaussian_att_params, glimpse_size)

in gaussian_glimpse(img_tensor, transform_params, crop_size)
29 uy, sy, dy, ux, sx, dx = tf.split(transform_params, 6, split_ax)
30 # create Gaussian masks, one for each axis
---> 31 Ay = gaussian_mask(uy, sy, dy, h, H)
32 Ax = gaussian_mask(ux, sx, dx, w, W)
33 # extract glimpse

in gaussian_mask(u, s, d, R, C)
14 mask = tf.exp(-.5 * tf.square(column_centres / s))
15 # we add eps for numerical stability
---> 16 normalised_mask = mask / (tf.reduce_sum(mask, 1, keep_dims=True) + 1e-8)
17 return normalised_mask
18

~\Anaconda2\envs\PythonCPU\lib\site-packages\tensorflow_core\python\util\dispatch.py in wrapper(*args, **kwargs)
178 """Call target, and fall back on dispatchers if there is a TypeError."""
179 try:
--> 180 return target(*args, **kwargs)
181 except (TypeError, ValueError):
182 # Note: convert_to_eager_tensor currently raises a ValueError, not a

TypeError: reduce_sum() got an unexpected keyword argument 'keep_dims'

from capsnet-tensorflow.

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.