Convert parameters of trained network into binary


#1

I have used the resnet-binary model in BMXnet to train my own dataset, after training,when i get the parameters in .model.param file, they are still in float. I try to convert it by using:
$ /build/Release/smd_hpi/tools/model_converter mnist-0001.params
but error was,
loading /home/jyi4hi/mxnet/smd_hpi/examples/binary-imagenet1k/facemodel-symbol.json…
|- adjusting attributes for stage1_unit1_conv1
|- adjusting attributes for stage1_unit1_conv2
|- adjusting attributes for stage1_unit1_sc
|- adjusting attributes for stage2_unit1_conv1
|- adjusting attributes for stage2_unit1_conv2
|- adjusting attributes for stage2_unit1_sc
|- adjusting attributes for stage3_unit1_conv1
|- adjusting attributes for stage3_unit1_conv2
|- adjusting attributes for stage3_unit1_sc
wrote converted json to /home/jyi4hi/mxnet/smd_hpi/examples/binary-imagenet1k/binarized_facemodel-symbol.json
loading /home/jyi4hi/mxnet/smd_hpi/examples/binary-imagenet1k/facemodel-0000.params…
|- converting weights arg:stage1_unit1_conv1_weight…
array shape: [16,16,3,3]
[09:47:46] /home/jyi4hi/mxnet/dmlc-core/include/dmlc/logging.h:308: [09:47:46] /home/jyi4hi/mxnet/smd_hpi/tools/model-converter/main.cpp:33: Check failed: array.shape()[1] % BITS_PER_BINARY_WORD == 0

set flag of the network are .
parser.set_defaults(
# network
network = ‘facedetector’,
num_layers = 20,
# data
data_train = train_fname,
data_val = val_fname,
num_classes = 2,
num_examples = 90000,
image_shape = ‘3,22,22’,
# train
batch_size = 128,
num_epochs = 100,
lr_step_epochs = ‘50,200,250’,
optimizer = ‘Nadam’,
disp_batches = 100,
lr = 0.01,
lr_factor = 0.1
)