I am trying to convert a caffe model to tensorflow model using caffe-tensorflow.
I am getting the below error
ValueError: cannot reshape array of size 0 into shape (16,3,3,3)'
method which throws the error:
def normalize_pb_data(self, layer):
transformed = []
for blob in layer.blobs:
print('layer name - %s %d' % (layer.name,len(blob.shape.dim)) )
if len(blob.shape.dim):
dims = blob.shape.dim
c_o, c_i, h, w = map(int, [1] * (4 - len(dims)) + list(dims))
else:
c_o = blob.num
c_i = blob.channels
h = blob.height
w = blob.width
if layer.name != "data/bias":
data = numpy.array(blob.data, dtype=np.float32).reshape(c_o, c_i, h, w)
transformed.append(data)
return transformed
Layer info from prototext:
layer {
name: "conv1"
type: "Convolution"
bottom: "data/bias"
top: "conv1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 16
bias_term: true
pad: 0
kernel_size: 3
group: 1
stride: 1
weight_filler {
type: "msra"
}
bias_filler {
type: "constant"
value: 0
}
dilation: 1
}
}