hpi-xnor / BMXNet

(New version is out: https://github.com/hpi-xnor/BMXNet-v2) BMXNet: An Open-Source Binary Neural Network Implementation Based on MXNet
Apache License 2.0
349 stars 95 forks source link

Bad indentation in resnet-binary.py #22

Closed ehsanmok closed 6 years ago

ehsanmok commented 6 years ago

Bad code is frustrating for people who wants to reproduce your results. There's a clear incorrect indentation in line 170 here so python train_cifar10.py --network resnet-binary cannot be executed as it was instructed here!

Even a small mistake damages the credibility of the results!

yanghaojin commented 6 years ago

to reproduce the result on cifar10, you don't need to change anything in "resnet-binary.py". The mentioned code line "170" is the experimental setting which was used to help us to build a model with both binary and full precision layer blocks. Those results have been also reported in our paper on imagenet dataset (ref. Table 2, have you ever read the paper before?). So I don't understand what your mean about this and the training on cifar10. We don't have any problem to run the training on cifar10, by using command line code like this:

python train_cifar10.py --log cifar10.log --data-train /data/mxnet_data/cifar10/cifar10_train.rec --data-val /data/mxnet_data/cifar10/cifar10_val.rec --network resnet-binary --gpus=0

INFO:root:start with arguments Namespace(batch_size=128, benchmark=0, data_nthreads=4, data_train='/data/mxnet_data/cifar10/cifar10_train.rec', data_val='/data/mxnet_data/cifar10/cifar10_val.rec', disp_batches=100, gpus='0', image_shape='3,32,32', kv_store='device', load_epoch=None, log_file='cifar10.log', lr=0.01, lr_factor=0.1, lr_step_epochs='50,200,250', max_random_aspect_ratio=0.25, max_random_h=36, max_random_l=50, max_random_rotate_angle=10, max_random_s=50, max_random_scale=1, max_random_shear_ratio=0.1, min_random_scale=1, model_prefix=None, mom=0.9, monitor=0, network='resnet-binary', num_classes=10, num_epochs=300, num_examples=50000, num_layers=18, optimizer='Adam', pad_size=0, pretrained=None, random_crop=1, random_mirror=1, rgb_mean='123.68,116.779,103.939', test_io=0, top_k=0, wd=0.0001) [09:50:10] /home/workspace/mxnet-HPI/src/io/iter_image_recordio_2.cc:170: ImageRecordIOParser2: /data/mxnet_data/cifar10/cifar10_train.rec, use 4 threads for decoding.. [09:50:11] /home/workspace/mxnet-HPI/src/io/iter_image_recordio_2.cc:170: ImageRecordIOParser2: /data/mxnet_data/cifar10/cifar10_val.rec, use 4 threads for decoding.. [09:50:14] /home/workspace/mxnet-HPI/src/operator/././cudnn_algoreg-inl.h:107: Running performance tests to find the best convolution algorithm, this can take a while... (setting env variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable) INFO:root:Epoch[0] Batch [100] Speed: 1754.40 samples/sec accuracy=0.180152 INFO:root:Epoch[0] Batch [200] Speed: 1805.58 samples/sec accuracy=0.204687 INFO:root:Epoch[0] Batch [300] Speed: 1754.10 samples/sec accuracy=0.247969 INFO:root:Epoch[0] Train-accuracy=0.272049 INFO:root:Epoch[0] Time cost=28.592 INFO:root:Epoch[0] Validation-accuracy=0.271163 INFO:root:Epoch[1] Batch [100] Speed: 1747.23 samples/sec accuracy=0.294013

ehsanmok commented 6 years ago

@yanghaojin thanks for your reply! I'm sorry I voiced my frustration inappropriately. You're right, there shouldn't be any issue.