看代码:
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
?
最佳答案
你可以试试
num = np.reshape(num,[100])
%100
是容器的长度
关于tensorflow - 我如何操作 <class 'google.protobuf.internal.containers.RepeatedScalarFieldContainer' >?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45390724/