Getting error while running with MNIST

While converting .pkl file into header file by running script with MNIST dataset I am getting below error.

Traceback (most recent call last):
File “”, line 362, in
generate_parameters(my_model, cmd_args.out_dir+’/parameter.h’)
File “”, line 94, in generate_parameters
f.write("#define “+layer.upper()+”_OUT_DIM “+str(caffe_model.layer_shape[layer][2])+”\n\n")
IndexError: tuple index out of range

I am new to Caffe, kindly give any suggestion.