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

keras model trained by tf.contrib.keras #10

Open
DaPenggg opened this issue Aug 24, 2018 · 0 comments
Open

keras model trained by tf.contrib.keras #10

DaPenggg opened this issue Aug 24, 2018 · 0 comments

Comments

@DaPenggg
Copy link

HI ,
I have train a keras mode based on tensorflow.contrib.keras and save it in h5 format. But it can't not run compress.py and some error。
Using TensorFlow backend.
Traceback (most recent call last):
File "F:/Project/text_classification/My_Text/compress_model.py", line 9, in
model = load_model('CNNTEXT/pretrain_cnn/model_3cnn.h5')
File "D:\Miniconda3\lib\site-packages\keras\models.py", line 240, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "D:\Miniconda3\lib\site-packages\keras\models.py", line 301, in model_from_config
return layer_module.deserialize(config, custom_objects=custom_objects)
File "D:\Miniconda3\lib\site-packages\keras\layers_init_.py", line 46, in deserialize
printable_module_name='layer')
File "D:\Miniconda3\lib\site-packages\keras\utils\generic_utils.py", line 140, in deserialize_keras_object
list(custom_objects.items())))
File "D:\Miniconda3\lib\site-packages\keras\engine\topology.py", line 2378, in from_config
process_layer(layer_data)
File "D:\Miniconda3\lib\site-packages\keras\engine\topology.py", line 2347, in process_layer
custom_objects=custom_objects)
File "D:\Miniconda3\lib\site-packages\keras\layers_init_.py", line 46, in deserialize
printable_module_name='layer')
File "D:\Miniconda3\lib\site-packages\keras\utils\generic_utils.py", line 141, in deserialize_keras_object
return cls.from_config(config['config'])
File "D:\Miniconda3\lib\site-packages\keras\engine\topology.py", line 1210, in from_config
return cls(**config)
File "D:\Miniconda3\lib\site-packages\keras\legacy\interfaces.py", line 88, in wrapper
return func(*args, **kwargs)
File "D:\Miniconda3\lib\site-packages\keras\layers\embeddings.py", line 88, in init
self.embeddings_initializer = initializers.get(embeddings_initializer)
File "D:\Miniconda3\lib\site-packages\keras\initializers.py", line 463, in get
return deserialize(identifier)
File "D:\Miniconda3\lib\site-packages\keras\initializers.py", line 458, in deserialize
printable_module_name='initializer')
File "D:\Miniconda3\lib\site-packages\keras\utils\generic_utils.py", line 141, in deserialize_keras_object
return cls.from_config(config['config'])
File "D:\Miniconda3\lib\site-packages\keras\initializers.py", line 21, in from_config
return cls(**config)
TypeError: init() got an unexpected keyword argument 'dtype'

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

1 participant