dessa-oss / fake-voice-detection

Using temporal convolution to detect Audio Deepfakes
http://www.atlas.dessa.com
Apache License 2.0
349 stars 86 forks source link

Importing model using Tf and Keras Error #13

Open mendaxfz opened 4 years ago

mendaxfz commented 4 years ago

Importing the model using tensorflow and keras gives me the following error:

NameError Traceback (most recent call last)

in () ----> 1 model = tf.keras.models.load_model('model.h5') 12 frames /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/layers/core.py in (x) 680 681 def compute_output_shape(self, input_shape): --> 682 input_shape = tensor_shape.as_shape(input_shape).as_list() 683 if not input_shape: 684 output_shape = tensor_shape.TensorShape([1]) NameError: name 'customPooling' is not defined
ranasac19878 commented 4 years ago

I think you will need to save the customPooling layer as custom object while saving your model. See below link for help: https://www.tensorflow.org/guide/keras/save_and_serialize