You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you to the authors for making your research, code, and results public. I'm trying to run the model from sarcasm_detection_model_CNN_LSTM_DNN.py but keep coming across this error:
model loaded from file...
Traceback (most recent call last):
File "sarcasm_detection_model_CNN_LSTM_DNN.py", line 314, in
t.load_trained_model(model_file='model.json', weight_file='model.json.hdf5')
File "sarcasm_detection_model_CNN_LSTM_DNN.py", line 208, in load_trained_model
self.__load_model(self._model_file_path + model_file, self._model_file_path + weight_file)
File "sarcasm_detection_model_CNN_LSTM_DNN.py", line 215, in __load_model
self.model.load_weights(model_weight_path)
File "C:\Users\Me\Anaconda3\envs\sarcasmpy\lib\site-packages\keras\models.py", line 768, in load_weights
topology.load_weights_from_hdf5_group(f, layers, reshape=reshape)
File "C:\Users\Me\Anaconda3\envs\sarcasmpy\lib\site-packages\keras\engine\topology.py", line 3365, in load_weights_from_hdf5_group
str(len(filtered_layers)) + ' layers.')
ValueError: You are trying to load a weight file containing 7 layers into a model with 5 layers.
The model.json says that it uses Keras v 2.1.6, which I'm using. I'm also working with Python 3.7.
Has anyone come across this? Thanks for your help.
The text was updated successfully, but these errors were encountered:
The model.json file seems to be missing conv1d_2 and lstm_2. Adding them has fixed the issue, though I'm not sure if that's the right way to go about it.
Is there an up-to-date model.json which matches the weights shared on Google Drive?
Hi there,
Thank you to the authors for making your research, code, and results public. I'm trying to run the model from
sarcasm_detection_model_CNN_LSTM_DNN.py
but keep coming across this error:model loaded from file...
Traceback (most recent call last):
File "sarcasm_detection_model_CNN_LSTM_DNN.py", line 314, in
t.load_trained_model(model_file='model.json', weight_file='model.json.hdf5')
File "sarcasm_detection_model_CNN_LSTM_DNN.py", line 208, in load_trained_model
self.__load_model(self._model_file_path + model_file, self._model_file_path + weight_file)
File "sarcasm_detection_model_CNN_LSTM_DNN.py", line 215, in __load_model
self.model.load_weights(model_weight_path)
File "C:\Users\Me\Anaconda3\envs\sarcasmpy\lib\site-packages\keras\models.py", line 768, in load_weights
topology.load_weights_from_hdf5_group(f, layers, reshape=reshape)
File "C:\Users\Me\Anaconda3\envs\sarcasmpy\lib\site-packages\keras\engine\topology.py", line 3365, in load_weights_from_hdf5_group
str(len(filtered_layers)) + ' layers.')
ValueError: You are trying to load a weight file containing 7 layers into a model with 5 layers.
The
model.json
says that it uses Keras v 2.1.6, which I'm using. I'm also working with Python 3.7.Has anyone come across this? Thanks for your help.
The text was updated successfully, but these errors were encountered: