inference-pre-ensemble-get-input.py 文件源码

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

项目:youtube-8m 作者: wangheda 项目源码 文件源码
def write_to_record(id_batch, label_batch, input_batch, filenum, num_examples_processed):
    writer = tf.python_io.TFRecordWriter(FLAGS.output_dir + '/' + 'predictions-%04d.tfrecord' % filenum)
    for i in range(num_examples_processed):
        video_id = id_batch[i]
        label = np.nonzero(label_batch[i,:])[0]
        example = get_output_feature(video_id, label, [input_batch[i,:]], ['input'])
        serialized = example.SerializeToString()
        writer.write(serialized)
    writer.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号