Traceback (most recent call last):
File "D:/master/Multi-level-DCNet-master/3leveldcnet.py", line 342, in <module>
routings=args.routings)
File "D:/master/Multi-level-DCNet-master/3leveldcnet.py", line 60, in MultiLevelDCNet
conv, nb_filter = densenet.DenseBlock(x, growth_rate=32, nb_layers=8, nb_filter=32)
File "D:\master\Multi-level-DCNet-master\densenet.py", line 64, in DenseBlock
cb = __conv_block(x, growth_rate, bottleneck, dropout_rate, weight_decay)
File "D:\master\Multi-level-DCNet-master\densenet.py", line 27, in __conv_block
x = BatchNormalization(axis=concat_axis, epsilon=1.1e-5)(ip)
File "D:\Anaconda\envs\tensorflow\lib\site-packages\keras\engine\topology.py", line 575, in __call__
self.build(input_shapes[0])
File "D:\Anaconda\envs\tensorflow\lib\site-packages\keras\layers\normalization.py", line 103, in build
constraint=self.gamma_constraint)
File "D:\Anaconda\envs\tensorflow\lib\site-packages\keras\legacy\interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "D:\Anaconda\envs\tensorflow\lib\site-packages\keras\engine\topology.py", line 399, in add_weight
constraint=constraint)
File "D:\Anaconda\envs\tensorflow\lib\site-packages\keras\backend\tensorflow_backend.py", line 323, in variable
v.constraint = constraint
AttributeError: can't set attribute
Modify parts of the code:
v = tf.Variable(value, dtype=_convert_string_dtype(dtype), name=name)
if isinstance(value, np.ndarray):
v._keras_shape = value.shape
elif hasattr(value, 'get_shape'):
v._keras_shape = int_shape(value)
v._uses_learning_phase = False
# TODO: move to `tf.get_variable` when supported in public release.
v.constraint = constraint #Modify to v._constraint = constraint
return v
Read More:
- [Solved] YOLO v5 Error: AttributeError: Can‘t get attribute SPPF on module models
- [Solved] Training yolov5 Error: attributeerror: can get attribute sppf on Module
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- [Solved] Python Keras Error: AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] AttributeError: module ‘tensorflow._api.v2.train‘ has no attribute ‘AdampOptimizer‘
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- [Solved] Error: AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- [Solved] Pytorch-transformers Error: AttributeError: ‘str‘ object has no attribute ‘shape‘
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]
- Python AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
- BlazingSQL Error: AttributeError: module ‘cio‘ has no attribute ‘RunQueryError‘
- [Solved] AttributeError: Manager isn‘t available; ‘auth.User‘ has been swapped for ‘
- How to Solve attributeerror: ‘list’ object has no attribute ‘shape‘
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- [Solved] pandas ExcelWrite AttributeError: ‘NoneType‘ object has no attribute ‘group‘