Skip to content

Commit 9ec520e

Browse files
Add build target to invoke the MNIST data download script
The `download-mnist` target can be used as a dependency by any build target that requires the MNIST handwritten digit dataset (for example, test suites running integration tests for machine learning techniques). No 'clean' option is provided since it is assumed that in general this data should be downloaded once and re-used; the script will verify its continued validity. The download location can be specified to `make` by setting an explicit `MNIST_DATA_DIR` variable, either in `Config.local.mak` or when invoking `make` directly. If this is not provided, the script will fall back to using any predefined `MNIST_DATA_DIR` environment variable, and if that is not available, to its default of `${HOME}/.cache/mnist`. In general however this should not be necessary, since the defaults will work fine for local testing, while CI setup can ensure `MNIST_DATA_DIR` is defined if needed in that context (e.g. by explicitly setting it in the docker image, or in the config for CI environment variables).
1 parent 3933470 commit 9ec520e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Build.mak

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ endif
1111
# use NaiveEngine (non-threaded) MXNet engine since the default (threaded)
1212
# version dead locks
1313
%test: export MXNET_ENGINE_TYPE=NaiveEngine
14+
15+
.PHONY: download-mnist
16+
download-mnist: $C/script/download-mnist
17+
$(call exec,sh $(if $V,,-x) $^,$(MNIST_DATA_DIR),$^)

0 commit comments

Comments
 (0)