Skip to content

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

@gunju

Description

@gunju

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions