Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Your code nowhere defines face_detector. If this is not a TF model, this will not work. Commented Nov 17, 2024 at 18:16
  • yes, it isn't a TF model, but it would be strange if there's no way to integrate non-TF models to TF-model training Commented Nov 19, 2024 at 8:25
  • Well what is it? You did not specify this anywhere. You need to backpropagate through the model for training to compute the gradients, TF doesn't know how to compute the gradient for some non-TF model. The only way would be to define a tf.custom_gradient for the face detector. Or implement it in Tensorflow/Keras. Commented Nov 19, 2024 at 10:23
  • i don't want to train face detector, i just want TF to ignore it and let it do its work Commented Nov 19, 2024 at 10:27
  • But your GAN loss is based on your face detector... so to compute the gradients of the loss with respect to the GAN variables, you need to backpropagate through the face detector. Which TF does not know how to do if it is not defined in terms of TF operations. If you want it to "ignore" the face detector, the solution is to not use it like this. Commented Nov 19, 2024 at 18:03