export_model.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Y8M 作者: mpekalski 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号