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

removes python path insert of tests folder for examples #9151

Merged
merged 19 commits into from Jan 15, 2018

Conversation

rahul003
Copy link
Member

Description

Some examples insert a folder to the python path to fetch a file from tests/ folder. This causes few problems
1. It requires the user to have the whole mxnet repository, with the directory structure intact
2. It means the user can't run the example standalone
3. For distributed training this means we would have to synchronize the whole mxnet directory across all machines.
This is unnecessary and inconvenient for the user.

Checklist

Essentials

  • Passed code style checking (make lint)
  • 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
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Moves get_mnist_pkl, get_mnist_ubyte, get_mnist_iterator from tests folder to mxnet.test_utils
  • Adds support to functions that generate data iterators for partitioning of datasets so that different workers in distributed training can use different parts of the dataset.

Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Signed-off-by: Rahul <rahulhuilgol@gmail.com>
and removing pythonpath inserts for get_data, by moving them to test_utils

Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Punctuation and minor changes
and address some review comments

Signed-off-by: Rahul <rahulhuilgol@gmail.com>
Copy link
Contributor

@aaronmarkham aaronmarkham left a comment

Choose a reason for hiding this comment

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

Instead of .test_utils can we use gluon model zoo and gluon's data iterator?

zf.extractall('data')

def get_mnist_iterator(batch_size, input_shape, num_parts=1, part_index=0):
"""Returns training and validation iterators for MNIST dataset
Copy link
Member

Choose a reason for hiding this comment

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

Can we add more documentation to this function about the expected location of the dataset (data/train-images-idx3-ubyte)?

@piiswrong piiswrong merged commit 11cb609 into apache:master Jan 15, 2018
CodingCat pushed a commit to CodingCat/mxnet that referenced this pull request Jan 16, 2018
* initial draft

* WIP tutorial

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* use logger

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* remove from old page

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* first draft of tutorial
and removing pythonpath inserts for get_data, by moving them to test_utils

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix typos

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* rename functions

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* small change in section heading

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix reimport

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update distributed_training.md

* Update distributed_training.md

Punctuation and minor changes

* fix gluon iterators
and address some review comments

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update multi_devices.md

* Update distributed_training.md

indentation change

* Update distributed_training.md

cmake instruction

* undo doc changes
larroy pushed a commit to larroy/mxnet that referenced this pull request Jan 18, 2018
* initial draft

* WIP tutorial

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* use logger

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* remove from old page

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* first draft of tutorial
and removing pythonpath inserts for get_data, by moving them to test_utils

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix typos

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* rename functions

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* small change in section heading

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix reimport

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update distributed_training.md

* Update distributed_training.md

Punctuation and minor changes

* fix gluon iterators
and address some review comments

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update multi_devices.md

* Update distributed_training.md

indentation change

* Update distributed_training.md

cmake instruction

* undo doc changes
yuxiangw pushed a commit to yuxiangw/incubator-mxnet that referenced this pull request Jan 25, 2018
* initial draft

* WIP tutorial

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* use logger

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* remove from old page

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* first draft of tutorial
and removing pythonpath inserts for get_data, by moving them to test_utils

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix typos

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* rename functions

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* small change in section heading

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix reimport

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update distributed_training.md

* Update distributed_training.md

Punctuation and minor changes

* fix gluon iterators
and address some review comments

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update multi_devices.md

* Update distributed_training.md

indentation change

* Update distributed_training.md

cmake instruction

* undo doc changes
@rahul003 rahul003 deleted the rm-pythonpath branch April 6, 2018 08:38
rahul003 added a commit to rahul003/mxnet that referenced this pull request Jun 4, 2018
* initial draft

* WIP tutorial

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* use logger

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* remove from old page

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* first draft of tutorial
and removing pythonpath inserts for get_data, by moving them to test_utils

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix typos

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* rename functions

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* small change in section heading

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix reimport

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update distributed_training.md

* Update distributed_training.md

Punctuation and minor changes

* fix gluon iterators
and address some review comments

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update multi_devices.md

* Update distributed_training.md

indentation change

* Update distributed_training.md

cmake instruction

* undo doc changes
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
* initial draft

* WIP tutorial

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* WIP tutorial, with mnist script changes

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* use logger

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* remove from old page

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* first draft of tutorial
and removing pythonpath inserts for get_data, by moving them to test_utils

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix typos

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* rename functions

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* small change in section heading

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* fix reimport

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update distributed_training.md

* Update distributed_training.md

Punctuation and minor changes

* fix gluon iterators
and address some review comments

Signed-off-by: Rahul <rahulhuilgol@gmail.com>

* Update multi_devices.md

* Update distributed_training.md

indentation change

* Update distributed_training.md

cmake instruction

* undo doc changes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants