Tensorflow 我如何操作<;类别';protobuf.internal.containers.RepeatedScalarFieldContainer'>;?
查看代码:Tensorflow 我如何操作<;类别';protobuf.internal.containers.RepeatedScalarFieldContainer'>;?,tensorflow,Tensorflow,查看代码: for serialize_str in tf.python_io.tf_record_iterator(records_name): example = tf.train.Example() example.ParseFromString(serialize_str) image = example.features.feature['data'].bytes_list.value height = example.features.feature[
for serialize_str in tf.python_io.tf_record_iterator(records_name):
example = tf.train.Example()
example.ParseFromString(serialize_str)
image = example.features.feature['data'].bytes_list.value
height = example.features.feature['height'].int64_list.value
我打印高度和图像的类型,它们都是
,但我知道我将int64存储为高度,所以我应该如何将google.protobuf.internal.containers.RepeatedScalarFieldContainer
转换为int64
?我的,您可以试试
num = np.reshape(num,[100])
%100
是容器的长度试试example.features.features['height'].int64_list.value[0]如果height是一个包含许多整数的int64列表,您有没有其他方法来遍历google.protobuf.internal.containers.RepeatedScalarFieldContainer
?它还实现了迭代器接口