zhangchenxu528 / FACIAL

FACIAL: Synthesizing Dynamic Talking Face With Implicit Attribute Learning. ICCV, 2021.
GNU Affero General Public License v3.0
376 stars 83 forks source link

Solution about Tensorflow2.x, get KeyError: "The name 'deepspeech.input_lengths:0' #94

Open qwert1887 opened 3 weeks ago

qwert1887 commented 3 weeks ago

audio2face/_utils/audio_handler.py

        # Load graph and place_hoders
        with tf.io.gfile.GFile(self.config['deepspeech_graph_fname'], "rb") as f:
            graph_def = tf.compat.v1.GraphDef()
            graph_def.ParseFromString(f.read())

        graph = tf.compat.v1.get_default_graph()
        tf.compat.v1.import_graph_def(graph_def, name="deepspeech")
        input_tensor = graph.get_tensor_by_name('input_node:0')
        seq_length = graph.get_tensor_by_name('input_lengths:0')
        layer_6 = graph.get_tensor_by_name('logits:0')