610265158 / face_landmark

A simple method for face alignment based on wingloss and mutitask learning :)
Apache License 2.0
251 stars 80 forks source link

Two questions about the codes. #22

Closed XP-CHRC closed 4 years ago

XP-CHRC commented 4 years ago

1.net_work.py line 221: summaries = tf.get_collection('%smutiloss' % scope, scope) line 239: summaries.append(tf.summary.histogram(var.op.name + '/gradients', grad)) line 246: summaries.append(tf.summary.histogram(var.op.name, var))

u just made a summaries list, but didn't use it later. Also, what's the meaning of:'%smutiloss' % scope, does there have var named '%smutiloss' % scope?(I guess you originally wanted to use:for var in summaries: do tf.summary.histogram() && self.summaries.append()??)

2.net_work.py line 254: train_op = tf.group(apply_gradient_op, variables_averages_op, *bn_update_ops)

What is the specific execution order? because in my mind, the bn_update_ops should executed before apply_gradient_op(for example: use the with tf.control_dependencies...), i don't know the specific mechanism.

Thanks!

610265158 commented 4 years ago

Hi, here is the answer for your question:

  1. I am not familiar with summaries, so it not used. You just could ignore these codes.
  2. I think it does not matter for the bn update. The mean and var is calculated by moving average, it is not so sensitive. And the mean and var are calculate when inference, so i think the mean and var are calculate before the apply_gradient_op.

Thanks