def build_prediction_graph(self, serialized_examples):
video_id, model_input_raw, labels_batch, num_frames = (
self.reader.prepare_serialized_examples(serialized_examples))
feature_dim = len(model_input_raw.get_shape()) - 1
model_input = tf.nn.l2_normalize(model_input_raw, feature_dim)
with tf.variable_scope("tower"):
result = self.model.create_model(
model_input,
num_frames=num_frames,
vocab_size=self.reader.num_classes,
labels=labels_batch,
is_training=False)
for variable in slim.get_model_variables():
tf.summary.histogram(variable.op.name, variable)
predictions = result["predictions"]
top_predictions, top_indices = tf.nn.top_k(predictions,
_TOP_PREDICTIONS_IN_OUTPUT)
return video_id, top_indices, top_predictions
export_model.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录