Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix the quantization script to support Python2 #13700

Merged
merged 2 commits into from
Dec 23, 2018
Merged

Conversation

juliusshufan
Copy link
Contributor

@juliusshufan juliusshufan commented Dec 20, 2018

Description

The existing quantization script under https://github.com/apache/incubator-mxnet/blob/master/example/quantization/imagenet_gen_qsym_mkldnn.py can't run properly on using Python 2.7. This PR provide a fix to make it compatible with Python2.x and 3.x.
@xinyu-intel @TaoLv

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

https://github.com/apache/incubator-mxnet/blob/master/example/quantization/imagenet_gen_qsym_mkldnn.py

@juliusshufan juliusshufan changed the title Fix the quantization script to support python2 Fix the quantization script to support Python2 Dec 20, 2018
Copy link
Member

@TaoLv TaoLv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have similar problem with imagenet_inference.py and imagenet_gen_qsym.py?

@juliusshufan
Copy link
Contributor Author

@TaoLv Thanks for the comments, I checked the two scripts you mentioned, and indeed the imagenet_inference.py has similiar issue and modify it accordingly, imagenet_gen_qsym.py works well with Python2.
Thanks.

@TaoLv TaoLv added Python pr-awaiting-review PR is waiting for code review labels Dec 20, 2018
Copy link
Member

@TaoLv TaoLv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix. LGTM.

Copy link
Contributor

@pengzhao-intel pengzhao-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the enhance.

@pengzhao-intel
Copy link
Contributor

@TaoLv could you help merge this one?

@TaoLv
Copy link
Member

TaoLv commented Dec 23, 2018

Thank you for the contribution. Now merging.

@TaoLv TaoLv merged commit 48bbac5 into apache:master Dec 23, 2018
rondogency pushed a commit to rondogency/incubator-mxnet that referenced this pull request Jan 9, 2019
* fix the quantization script to support python2

* Fix comments, fix similiar issue in imagenet_inference.py
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* fix the quantization script to support python2

* Fix comments, fix similiar issue in imagenet_inference.py
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants