After some time, messing with him and looking further in the documentation, I found my own answer. In the above function using the example code as a base:
def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) ... 'label': _int64_feature(labels[index]),
labels [index] are passed to the list as [value], so you have [np.array ([1,2,3])], which causes an error.
The above listing was necessary in the example, because tf.train.Int64List () expects either an array of a list or numpy, and the example is passed in one whole so that they list it as such.
In this example, it was like
label = [1,2,3,4] ... 'label': _int64_feature(label[index]) tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) #Where value = [1] in this case
If you want to go to the list, do it
labels = np.asarray([[1,2,3],[4,5,6]]) ... def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=value)) ... 'label': _int64_feature(labels[index]),
I will probably make a stretch request because I found the source documentation for tf.train.Feature is almost non-existent.
TL DR
Pass a list or numpy array to tf.train.Int64List (), but not a list of lists or a list of numpy arrays.