tid*_*idy 2 python computer-vision deep-learning conv-neural-network tensorflow
我正在阅读tensorflow模型的代码:https : //github.com/tensorflow/models/blob/master/slim/train_image_classifier.py
我对这个代码部分很困惑:
train_tensor = control_flow_ops.with_dependencies([update_op], total_loss,
name='train_op')
Run Code Online (Sandbox Code Playgroud)
control_flow_ops.with_dependencies 是什么意思?
该函数有两个参数control_flow_ops.with_dependencies(dependencies, output_tensor)
。第二个参数output_tensor
,而你的情况是total_loss
只计算后的所有操作dependencies
进行评估。顾名思义,output_tensor
依赖于正确评估的依赖项。此函数强制执行此行为。
依赖项是一个可迭代的操作,在您的情况下update_op
是列表中的一个。
归档时间: |
|
查看次数: |
1507 次 |
最近记录: |