TF2 : AttributeError: Can't set the attribute "trainable_weights", likely because it conflicts with an existing read-only @property of the object. Please choose a different name.
See original GitHub issueImplementation on TF2 gives me the error :
AttributeError: Can't set the attribute "trainable_weights", likely because it conflicts with an existing read-only @property of the object. Please choose a different name.
at the ssd_300 or ssd_500 model creation.
–> model = ssd_300(...)
with nothing changed to the parameters.
I have changed all the keras...
to tensorflow.keras...
,
and the keras.engine...
ones to tensorflow.keras.layers...
tf.__version__ : 2.0.0
from scipy.misc import imread
changed to from matplotlib.pyplot import imread
Anyone with a solution for this?
If more info is required, I would be glad to provide.
(I’m sorry for very brief explanation, I don’t have much time on my hands at this moment)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:11
Top Results From Across the Web
Can't set the attribute "trainable_weights", likely because it ...
It says Can't set the attribute "trainable_weights", likely because it conflicts with an existing read-only @property of the object. Please ...
Read more >tf.keras.layers.Layer | TensorFlow v2.11.0
It shows how to implement build() and call() . Variables set as attributes of a layer are tracked as weights of the layers...
Read more >tensorflow.python.keras.engine.base_layer - DCASE-models
Variables set as attributes of a layer are tracked as weights of the layers (in `layer.weights`). ```python class SimpleDense(Layer): def __init__(self, ...
Read more >Making a read-only attribute - Python Morsels
If you need to make a read-only attribute in Python, you can turn your attribute into a property that delegates to an attribute...
Read more >"Fossies" - the Fresh Open Source Software Archive
178 Variables set as attributes of a layer are tracked as weights 179 of the ... will fail if the object is 289...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I actually found the solution, You need to set self._trainable_weights instead of self.trainable_weights
Change the:
For: