How can I operate on <class 'google.protobuf.internal.containers.RepeatedScalarFieldContainer'>?

Viewed 1209

Look the code:

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

I print type of height and image, they are both <class 'google.protobuf.internal.containers.RepeatedScalarFieldContainer'>, but I know I store a int64 into height, so how should I transform google.protobuf.internal.containers.RepeatedScalarFieldContainer to int64?

1 Answers

my you could try

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

%100 is the length of your container

Related