blob.channels=0 after reading from mean.binaryproto file

12 views
Skip to first unread message

sgs

unread,
Mar 23, 2017, 3:39:47 AM3/23/17
to Caffe Users
I've created a binaryproto mean file for my dataset. After reading it when I use blob.channels it returns 0. Even blob.height returns 0. But when I use blob.shape it returns-
dim: 1
dim: 3
dim: 400
dim: 300

Which is exactly of same as the numpy array I created the blob from. 

Where am I doing wrong?

I used this code for reading binaryproto file:


import caffe.io
import numpy as np
import sys

if len(sys.argv)!=2:
   print "Too few arguments! Usage: per_channel_mean.py <input_proto_file>"
   sys.exit()

blob = caffe.proto.caffe_pb2.BlobProto()
proto_data = open( sys.argv[1] , 'rb' ).read()
blob.ParseFromString(proto_data)
print blob.channels


This one to create binaryproto: (this creates the file without using lmdb, taking images directly as input)
Reply all
Reply to author
Forward
0 new messages