declare-lab/MELD

Error on the function method test_model

tae898 opened this issue · 1 comments

Whenever below is called,

def test_model(self):
    model = load_model(self.PATH)
    intermediate_layer_model = Model(
    input=model.input, output=model.get_layer("utter").output)

tensorflow throws an error

Traceback (most recent call last):
  File "baseline/baseline.py", line 288, in <module>
    model.train_model()
  File "baseline/baseline.py", line 228, in train_model
    self.test_model()
  File "baseline/baseline.py", line 235, in test_model
    intermediate_layer_model = Model(input=model.input, output=model.get_layer("utter").output)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/tracking/base.py", line 457, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py", line 262, in __init__
    'name', 'autocast'})
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/generic_utils.py", line 778, in validate_kwargs
    raise TypeError(error_message, kwarg)
TypeError: ('Keyword argument not understood:', 'input')

Perhaps utter is not the right name of the layer?

Running on python3.6, running below python packages

tensorboard==2.3.0
tensorboard-plugin-wit==1.7.0
tensorboardcolab==0.0.22
tensorflow==2.3.0
tensorflow-addons==0.8.3
tensorflow-datasets==2.1.0
tensorflow-estimator==2.3.0
tensorflow-gcs-config==2.3.0
tensorflow-hub==0.9.0
tensorflow-metadata==0.24.0
tensorflow-privacy==0.2.2
tensorflow-probability==0.11.0
Keras==2.4.3
Keras-Preprocessing==1.1.2
keras-vis==0.4.1

I found the fix.

keras Model class expects kwargs inputs and outputs, not input and output

intermediate_layer_model = Model(
	inputs=model.input, outputs=model.get_layer("utter").output)