-
Notifications
You must be signed in to change notification settings - Fork 6.8k
cannot quantization example #17231
Comments
@eric-haibin-lin Thanks for reporting this. May I know if calibration=naive will crash or not? |
@ZhennanQin I tried to set calib-mode to 'naive', met the same error. Error message as follows INFO:logger:Namespace(batch_size=32, calib_dataset='data/val_256_q90.rec', calib_mode='naive', data_nthreads=60, enable_calib_quantize=True, epoch=0, exclude_first_conv=False, image_shape='3,224,224', label_name='softmax_label', model='resnet50_v1', no_pretrained=False, num_calib_batches=10, quantized_dtype='auto', quiet=False, shuffle_chunk_seed=3982304, shuffle_dataset=True, shuffle_seed=48564309) Segmentation fault: 11 |
@zhhoper Thanks for the information. Will investigate this soon. |
@zhhoper From my side, I cannot reproduce this issue with latest master in my local machine. May I know which mxnet version (commit id) do you use? Recently we have provided a PR to fix |
@zhhoper Any update for this issue? |
@wuxun-zhang Sorry that I haven't been able to touch that after reporting the bug. Will take a look at that and let you know if the bug is still there. |
@wuxun-zhang @ZhennanQin I run the example using mxnet 1.6.0, it seems to work ok. However, the run time of quantized model is much slower (more than 10 times) than the original one. Is there anything I need to set up in order to speed up the quantized model? For quantized model |
@zhhoper May I know your exact command to build MXNet from source? And your complete benchamrk commands? Thanks. |
Hi, the mxnet build from source does not seem to work. I install the mxnet with pip, it can compress the network but the run time is super slow. The mxnet version is 1.6.0. |
I am also facing the same Issue, but I am getting the segmentation fault error while quantizing the network with calib-mode="entropy", but for calib-mode="naive" it worked fine. My mxnet version is 1.6.0, which I downloaded using pip as follows pip3 install mxnet-cu101mkl Below is the command I have executed and error I got python imagenet_gen_qsym_mkldnn.py --model=vgg19 --num-calib-batches=782 --calib-mode=entropy INFO:logger:Collecting layer sg_mkldnn_conv_act_12_output histogram of shape (32, 512, 14, 14) |
I have tried mxnet docker image and now I am getting a new error while running same command as below Aborted (core dumped) What is happening? |
@venkat-kittu Can you try again with the latest nightly build via |
@wuxun-zhang Nope it's not working, it's only working when I keep --num-calib-batches=33. Except for numbers less than 33, it's not working for any higher number. |
I can exactly reproduce this issue (when |
@venkat-kittu I have just provided a patch here wuxun-zhang@c06a715, could you please try it out and verify if it can resolve your issue? Thanks. |
sorry, for the late reply......Now I have kept it aside for some time, but when I start I will let you know. |
Description
(A clear and concise description of what the bug is.)
I try to run quantization example:
python imagenet_gen_qsym_mkldnn.py and met the segmentation fault. The details of output is as follows:
Error Message
(Paste the complete error message. Please also include stack trace by setting environment variable
DMLC_LOG_STACK_TRACE_DEPTH=10
before running your script.)INFO:logger:Namespace(batch_size=32, calib_dataset='data/val_256_q90.rec', calib_mode='entropy', data_nthreads=60, enable_calib_quantize=True, epoch=0, exclude_first_conv=False, image_shape='3,224,224', label_name='softmax_label', model='resnet50_v1', no_pretrained=False, num_calib_batches=10, quantized_dtype='auto', quiet=False, shuffle_chunk_seed=3982304, shuffle_dataset=True, shuffle_seed=48564309)
INFO:logger:shuffle_dataset=True
INFO:logger:calibration mode set to entropy
INFO:logger:Get pre-trained model from MXNet or Gluoncv modelzoo.
INFO:logger:If you want to use custom model, please set --no-pretrained.
INFO:logger:model resnet50_v1 is converted from GluonCV
INFO:logger:Converting model from Gluon-CV ModelZoo resnet50_v1... into path /home/ubuntu/software/incubator-mxnet/example/quantization/model
Model file is not found. Downloading.
Downloading /home/ubuntu/.mxnet/models/resnet50_v1-cc729d95.zip from https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/models/resnet50_v1-cc729d95.zip...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 57421/57421 [00:00<00:00, 57938.39KB/s]
/home/ubuntu/anaconda3/envs/mxnet_0.15/lib/python3.6/site-packages/mxnet-1.6.0-py3.6.egg/mxnet/module/base_module.py:67: UserWarning: Data provided by label_shapes don't match names specified by label_names ([] vs. ['softmax_label'])
warnings.warn(msg)
[00:03:02] ../src/executor/graph_executor.cc:1982: Subgraph backend MKLDNN is activated.
INFO:logger:batch size = 32 for calibration
INFO:logger:number of batches = 10 for calibration
INFO:logger:These layers have been excluded []
INFO:logger:label_name = softmax_label
INFO:logger:Input data shape = (3, 224, 224)
INFO:logger:rgb_mean = 123.68,116.779,103.939
INFO:logger:rgb_std = 58.393, 57.12, 57.375
INFO:logger:Creating ImageRecordIter for reading calibration dataset
[00:03:02] ../src/io/iter_image_recordio_2.cc:178: ImageRecordIOParser2: data/val_256_q90.rec, use 16 threads for decoding..
Segmentation fault: 11
The text was updated successfully, but these errors were encountered: