查看代码:
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
?
答案 0 :(得分:-2)
我可以尝试
num = np.reshape(num,[100])
%100
是您的容器的长度