<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: N/A</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Docker nightly</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: Docker nightly</li>
<li><strong>TensorFlow version (use command below)</strong>: Docker nightly</li>
<li><strong>Python version</strong>: Docker nightly</li>
<li><strong>Bazel version (if compiling from source)</strong>: Docker nightly</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: Docker nightly</li>
<li><strong>CUDA/cuDNN version</strong>: Docker nightly</li>
<li><strong>GPU model and memory</strong>:  N/A</li>
<li><strong>Exact command to reproduce</strong>: N/A</li>
</ul>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">Please add <code class="notranslate">warm_start_from</code> parameter in <code class="notranslate">tf.model_to_estimator</code></p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">N/A</p>
<p dir="auto">The Golang api <a href="https://godoc.org/github.com/tensorflow/tensorflow/tensorflow/go#Tensor.WriteContentsTo" rel="nofollow">WriteContentsTo</a> can be used to writes the serialized contents of a tensor to io.Writer, where the tensor is built from golang scalars, slices, and arrays.</p>
<p dir="auto">Yet there's not a Golang API to serialize data into tf.Example protos(tfrecords).</p>
<p dir="auto">For example, when i want serialize a libsvm into tf.Example protos, i can do this by:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def libsvm2tfrecords(data_source, target_dir, delimiter='\t'):
    &quot;&quot;&quot;
    a single file should not contain lines more than 1000,000, or we should use libsvm2proto_par
    :param data_source: libsvm file path
    :param target_dir: dir to storage the serialize proto file
    :param delimiter: delimiter for csv reader
    :return:
    &quot;&quot;&quot;
    if not os.path.isfile(data_source):
        raise ValueError('data file passed do not exist or not a file')

    file_name = os.path.join(target_dir, os.path.splitext(
        os.path.basename(data_source))[0] + '.tfrecords')
    writer = tf.python_io.TFRecordWriter(file_name)
    start = datetime.now()
    line_c = 0
    with open(data_source, 'rb') as rf:
        f_reader = csv.reader(rf, delimiter=delimiter, quotechar='|')
        for row in f_reader:
            line_c += 1
            feature = dict()
            indexes = []
            values = []
            feature.update({'label': _float_feature([float(row[0])])})
            for e in row[1:]:
                index, value = e.split(':')
                indexes.append(int(index))
                values.append(float(value))
                feature.update({'index': _int64_feature(indexes)})
                feature.update({'value': _float_feature(values)})

            example = tf.train.Example(features=tf.train.Features(feature=feature))
            writer.write(example.SerializeToString())

        writer.close()
        end = datetime.now()

        print(&quot;- consumed time: %ds for %s&quot; % ((end-start).seconds, data_source))"><pre class="notranslate"><code class="notranslate">def libsvm2tfrecords(data_source, target_dir, delimiter='\t'):
    """
    a single file should not contain lines more than 1000,000, or we should use libsvm2proto_par
    :param data_source: libsvm file path
    :param target_dir: dir to storage the serialize proto file
    :param delimiter: delimiter for csv reader
    :return:
    """
    if not os.path.isfile(data_source):
        raise ValueError('data file passed do not exist or not a file')

    file_name = os.path.join(target_dir, os.path.splitext(
        os.path.basename(data_source))[0] + '.tfrecords')
    writer = tf.python_io.TFRecordWriter(file_name)
    start = datetime.now()
    line_c = 0
    with open(data_source, 'rb') as rf:
        f_reader = csv.reader(rf, delimiter=delimiter, quotechar='|')
        for row in f_reader:
            line_c += 1
            feature = dict()
            indexes = []
            values = []
            feature.update({'label': _float_feature([float(row[0])])})
            for e in row[1:]:
                index, value = e.split(':')
                indexes.append(int(index))
                values.append(float(value))
                feature.update({'index': _int64_feature(indexes)})
                feature.update({'value': _float_feature(values)})

            example = tf.train.Example(features=tf.train.Features(feature=feature))
            writer.write(example.SerializeToString())

        writer.close()
        end = datetime.now()

        print("- consumed time: %ds for %s" % ((end-start).seconds, data_source))
</code></pre></div>
<p dir="auto">BUT Golang api does not seem to be able to achieve this.</p>