Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloaded keras_model.h5 is not working - ValueError: Unknown layer: Functional #150

Open
hs1003 opened this issue Nov 9, 2020 · 1 comment

Comments

@hs1003
Copy link

hs1003 commented Nov 9, 2020

I downloaded keras weight file and call "model = tensorflow.keras.models.load_model('converted_keras/keras_model.h5')".
But it is not working with some error log.
I have a weight file when I downloaded in October, this model file is perfectly working.
But now, it is not working with this error.
Please help me!
=====================[ Error Log ] ==================
c:\users\pc\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\keras\utils\generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
178 config = identifier
179 (cls, cls_config) = class_and_config_for_serialized_keras_object(
--> 180 config, module_objects, custom_objects, printable_module_name)
181
182 if hasattr(cls, 'from_config'):

c:\users\pc\appdata\local\programs\python\python37\lib\site-packages\tensorflow_core\python\keras\utils\generic_utils.py in class_and_config_for_serialized_keras_object(config, module_objects, custom_objects, printable_module_name)
163 cls = module_objects.get(class_name)
164 if cls is None:
--> 165 raise ValueError('Unknown ' + printable_module_name + ': ' + class_name)
166 return (cls, config['config'])
167

ValueError: Unknown layer: Functional

@hs1003 hs1003 changed the title Downloaded keras_model.h5 is not working Downloaded keras_model.h5 is not working - ValueError: Unknown layer: Functional Nov 9, 2020
@cenzwong
Copy link

Upgrade the tensorflow to version 2.3.x, this might solve your problem.

When updating tensorflow, you might encounter this error:

After October 2020 you may experience errors when installing or updating package
s. This is because pip will change the way that it resolves dependency conflicts. 

We recommend you use --use-feature=2020-resolver to test your packages with the new res
olver before it becomes the default.

just run this to upgrade your tensorflow

!pip install --upgrade tensorflow --use-feature=2020-resolver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants