我如何操作<class'google.protobuf.internal.containers.repeatedscalarfieldcontainer'=“”>?

时间:2017-07-29 15:03:09

标签: 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['height'].int64_list.value

我打印高度和图像类型,它们都是<class 'google.protobuf.internal.containers.RepeatedScalarFieldContainer'>,但我知道我将int64存储到高度,那么我应该如何将google.protobuf.internal.containers.RepeatedScalarFieldContainer转换为int64

1 个答案:

答案 0 :(得分:-2)

我可以尝试

num = np.reshape(num,[100])

%100是您的容器的长度