You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/01 16:59:51 UTC

[GitHub] nswamy commented on a change in pull request #11636: [MXNET-769] set MXNET_DATA_DIR as base for downloaded models through base.data_dir()

nswamy commented on a change in pull request #11636: [MXNET-769] set MXNET_DATA_DIR as base for downloaded models through base.data_dir()
URL: https://github.com/apache/incubator-mxnet/pull/11636#discussion_r206957107
 
 

 ##########
 File path: python/mxnet/base.py
 ##########
 @@ -59,6 +59,26 @@
     py_str = lambda x: x
 
 
+def data_dir_default():
+    """
+
+    :return: default data directory depending on the platform and environment variables
+    """
+    system = platform.system()
+    if system == 'Windows':
+        return os.path.join(os.environ.get('APPDATA'), 'mxnet')
+    else:
+        return os.path.join(os.path.expanduser("~"), '.mxnet')
+
+
+def data_dir():
+    """
+
+    :return: data directory in the filesystem for storage, for example when downloading models
+    """
+    return os.getenv('MXNET_DATA_DIR', data_dir_default())
 
 Review comment:
   MXNET_DATA_DIR is the place where we download models/training/test/other data. 
   MXNET_HOME sounds like a place where you have library, for example if you want set it to PYTHONPATH

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services