Open hassenhamdi opened 6 months ago
Which model are you trying to use? Also your TF version?
Hi , thanks for the response , Here is my specs :
Operating System: Manjaro Linux
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Kernel Version: 6.6.26-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-10750H CPU @ 2.60GHz
Memory: 11,5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: HP
Product Name: HP Pavilion Gaming Laptop 15-dk1xxx
System Version: Type1ProductConfigId
I have tensorflow 2.15.0
The issue is with the models listed under model backbone most of them give me the policy error , deserilisation error , 'unrecognized keyword argument passed to "layer" and AttributeError: 'str' object has no attribute 'convert_input'
,the other ported works fine ,
I did try on google colab to verify the result and gave me the same result . Additional I want to note that the tensorflow_addon in eval.py raise error even when the package is installed "ModuleNotFoundError: No module named 'keras.src.engine' " so I just deleted the import line as it not used anyway.
Just tested EfficientNetV2B0
and r100
, and they work find under TF 2.15.0
, but I can reproduce your error with TF 2.16.0
.
TF_USE_LEGACY_KERAS=1 python evals.py .....
, or export TF_USE_LEGACY_KERAS=1
works for you.TF 2.16.0
with keras 3.0
version. Many things just broken with TF newest version...If that doesn't work either, try build basic_model
following Training
part in the table, and load_weights
, like:
from keras_cv_attention_models import efficientnet
import models
basic_model = efficientnet.EfficientNetV2B0(input_shape=(112, 112, 3), num_classes=0)
basic_model = models.buildin_models(basic_model, dropout=0, emb_shape=512, output_layer='GDC', bn_epsilon=1e-4, bn_momentum=0.9, scale=True, use_bias=False)
basic_model.load_weights('xxxx.h5')
I still getting the same error with backbone model , they need their backbone python files implementation and then loading weights as you suggested . I I tried this on my personal using tf 2.15.0 and keras 3.2.0 and the error still appear using your update evals.py file that contain the checks . Thanks to God , The ported model still work and I am highly satisfied with its result , so it is not really an issue for me , any way I just wanted to bring your attention on the matter thanks for your work .
Palestine 🇵🇸 will be "Free" from the river to the sea :) .
when I try to load model I get this error