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

Sequential model input layer convert #129

Open
yanwang271 opened this issue Mar 6, 2022 · 3 comments
Open

Sequential model input layer convert #129

yanwang271 opened this issue Mar 6, 2022 · 3 comments

Comments

@yanwang271
Copy link

Hi Avanti,

I was trying to apply DeepLIFT to a sequential model. When using "kc.convert_model_from_saved_files" function, it gave error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "deeplift/deeplift/conversion/kerasapi_conversion.py", line 388, in convert_model_from_saved_files
    +" weights file which has layer names "+str(model_weights.keys()))
AssertionError: Layer conv1d_3_input is in the layer names but not in the  weights file which has layer names <KeysViewHDF5 ['conv1d', 'conv1d_1', 'conv1d_2', 'conv1d_3', 'dense', 'dense_1', 'dropout', 'dropout_1', 'flatten', 'max_pooling1d', 'max_pooling1d_1']>

The conv1d_3_input is the input layer, which should not have weights. Could you help me with it?

If it helps, below is part of the model config:

{'name': 'sequential', 'layers': [{'class_name': 'InputLayer', 'config': {'batch_input_shape': [None, 500, 4], 'dtype': 'float32', 'sparse': False, 'ragged': False, 'name': 'conv1d_3_input'}}, {'class_name': 'Conv1D', 'config': {'name': 'conv1d_3', 'trainable': True, 'batch_input_shape': [None, 500, 4], 'dtype': 'float32', 'filters': 32, 'kernel_size': [12], 'strides': [1], 'padding': 'valid', 'data_format': 'channels_last', 'dilation_rate': [1], 'groups': 1, 'activation': 'relu', 'use_bias': True, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'bias_initializer': {'class_name': 'Zeros', 'config': {}}, 'kernel_regularizer': None, 'bias_regularizer': None, 'activity_regularizer': None, 'kernel_constraint': None, 'bias_constraint': None}}, {'class_name': 'Conv1D', 'config': {'name': 'conv1d_2', 'trainable': True, 'dtype': 'float32', 'filters': 32, 'kernel_size': [12], 'strides': [1], 'padding': 'valid', 'data_format': 'channels_last', 'dilation_rate': [1], 'groups': 1, 'activation': 'relu', 'use_bias': True, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'bias_initializer': {'class_name': 'Zeros', 'config': {}}, 'kernel_regularizer': None, 'bias_regularizer': None, 'activity_regularizer': None, 'kernel_constraint': None, 'bias_constraint': None}}, ...

Thanks!
Yan

@AvantiShri

This comment was marked as off-topic.

@akundaje
Copy link

akundaje commented Mar 6, 2022 via email

@AvantiShri
Copy link
Collaborator

AvantiShri commented Mar 7, 2022 via email

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

3 participants