admin管理员组文章数量:1202373
I am trying to make a deepfake detection model which will work on both audio and video(Using mobilenetv2), thus, i am trying to build a model which will work on both
def build_model(input_shape=(224, 224, 3), num_classes=10):
frames_input = Input(shape=input_shape, name="frames_input")
spectrogram_input = Input(shape=input_shape, name="spectrogram_input")
x1 = MobileNetV2(weights="imagenet", include_top=False, input_tensor=frames_input)
for i, layer in enumerate(x1.layers):
layer._name = f"mobilenet_frames_{i}"
x1 = Flatten()(x1.output)
x2 = MobileNetV2(weights="imagenet", include_top=False, input_tensor=spectrogram_input)
for i, layer in enumerate(x2.layers):
layer._name = f"mobilenet_spectrogram_{i}"
x2 = Flatten()(x2.output)
merged = Concatenate()([x1, x2])
x = Dense(1024, activation="relu", name="dense_1")(merged)
x = Dense(512, activation="relu", name="dense_2")(x)
output = Dense(num_classes, activation="softmax", name="output")(x)
model = Model(inputs=[frames_input, spectrogram_input], outputs=output, name="deepfake_detection_model")
return model
the error is: ValueError: The name "Conv1" is used 2 times in the model. All operation names should be unique.
本文标签:
版权声明:本文标题:mobilenet - The name "Conv1" is used 2 times in the model. All operation names should be unique - Stack Overfl 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738651456a2104893.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论