AttributeError: 'Model' object has no attribute 'weighted_metrics' while calling set_trainable
See original GitHub issueHi,
while calling set_trainable(true) to fine tune a model (following the tutorial here: https://segmentation-models.readthedocs.io/en/latest/tutorial.html#fine-tuning ), I get the following error:
File "experiment0.py", line 75, in run_exp
set_trainable(model)
File "/home/benq/anaconda3/envs/tf2/lib/python3.7/site-packages/segmentation_models/utils.py", line 36, in set_trainable
weighted_metrics=model.weighted_metrics,
AttributeError: 'Model' object has no attribute 'weighted_metrics'
the model is Unet with resnet34 backbone, running on tensorflow 2.0. The first call tomodel.fit_generator works without issue.
Any idea?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
'Model' object has no attribute '_distribution_strategy' - Stack ...
I found the answer, fortunately. I forgot to call the superclass of the tensorflow keras model; I just had to add super(MyModel, self)....
Read more >Attributeerror: 'Model' Object Has No Attribute 'Epoch' - Keras
AttributeError : 'list' object has no attribute 'size' with HuggingFace model ... object has no attribute 'weightedmetrics' while calling settrainable #215.
Read more >Model object has no attribute '_is_graph_network', when I try ...
Model object has no attribute '_is_graph_network', when I try to save my model to tflite. Tensorflow version - 1.14.0 Python version - 3.7.5....
Read more >PYTHON : AttributeError: 'module' object has no attribute 'model'
PYTHON : AttributeError : 'module' object has no attribute ' model ' [ Gift : Animated Search Engine : https://www.hows.tech/p/recommended.html ] ...
Read more >Problem with load trained model - Part 1 (2019) - Fast.ai forums
But, when I run to load, I got this issue: AttributeError: 'Conv2d' object has no attribute 'padding_mode'. I tried updating the version, ...
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 Free
Top 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
I try your code and before yesterday it works, but yesterday when I try to recompile the network I obtain the error reported here, more precisely I have:
The same error of benqua, but I use Tensorflow-gpu 1.13.2 and I try tensorflow-gpu 1.15.0 and after the deletion of the
the result is an error on fit_generator:
I don’t know how to solve this issue. Can you help me, please?
I’m facing the same error, is there a known fix? @qubvel