chengtaipu / lowrankcnn

Low-rank convolutional neural networks
96 stars 44 forks source link

Error at lowrank_approx.py", line 41, in vh_decompose #10

Open chowkamlee81 opened 6 years ago

chowkamlee81 commented 6 years ago

I succesfully compiled caffe version of the code but Iam getting error after executing below command python2 lowrank_approx.py \ --model models_vgg/vgg_deploy.prototxt \ --config models_vgg/config.json \ --save_model models_vgg/vgg_lowrank_deploy.prototxt \ --weights VGG_ILSVRC_16_layers.caffemodel \ --save_weights vgg_lowrank.caffemodel

line 71, in make_lowrank_model v, h = vh_decompose(layer, conf[layer.name]) File "/home/jitesh/Embedded/Regularization/lowrankcnn-master/imagenet/lowrank_approx.py", line 41, in vh_decompose v_param.kernel_h, v_param.kernel_w = conv_param.kernel_size, 1 TypeError: [3L] has type google.protobuf.pyext._message.RepeatedScalarContainer, but expected one of: int, long

Kindly help me out to resolve this issue

chowkamlee81 commented 6 years ago

@Cysu , Kindly help me out to resolve this issue

agunapal commented 6 years ago

kernel_size is read as a list for some reason. Hence you need to modify the line to v_param.kernel_h, v_param.kernel_w = conv_param.kernel_size[0] if len(conv_param.kernel_size) else 0, 1