Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'int' object has no attribute 'value' #35

Open
gunju opened this issue Sep 25, 2020 · 0 comments
Open

AttributeError: 'int' object has no attribute 'value' #35

gunju opened this issue Sep 25, 2020 · 0 comments

Comments

@gunju
Copy link

gunju commented Sep 25, 2020

Hi, I am facing below issue:

AttributeErrorTraceback (most recent call last)
in ()
1 # Layer 1: Primary Capsule: Conv cap with routing 1
2 primary_caps = ConvCapsuleLayer(kernel_size=5, num_capsule=2, num_atoms=16, strides=2, padding='same',
----> 3 routings=1, name='primarycaps')(conv1_reshaped)

/home/ubuntu/anaconda3/envs/tensorflow2_p27/lib/python2.7/site-packages/keras/backend/tensorflow_backend.pyc in symbolic_fn_wrapper(*args, **kwargs)
73 if _SYMBOLIC_SCOPE.value:
74 with get_graph().as_default():
---> 75 return func(*args, **kwargs)
76 else:
77 return func(*args, **kwargs)

/home/ubuntu/anaconda3/envs/tensorflow2_p27/lib/python2.7/site-packages/keras/engine/base_layer.pyc in call(self, inputs, **kwargs)
487 # Actually call the layer,
488 # collecting output(s), mask(s), and shape(s).
--> 489 output = self.call(inputs, **kwargs)
490 output_mask = self.compute_mask(inputs, previous_mask)
491

capsule_layers.py in call(self, input_tensor, training)
138 votes = K.reshape(conv, [input_shape[1], input_shape[0], votes_shape[1], votes_shape[2],
139 self.num_capsule, self.num_atoms])
--> 140 votes.set_shape((None, self.input_num_capsule, conv_height.value, conv_width.value,
141 self.num_capsule, self.num_atoms))
142

AttributeError: 'int' object has no attribute 'value'

I am using python 3.6.5, keras 2.3.0 and tensorflow-gpu 2.0.0.

Shall I remove the value section and keep directly the values? I am getting values directly for conv network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant