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()
inference-pre-ensemble-get-input.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录