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/01/26 20:19:54 UTC

[GitHub] anirudh2290 commented on a change in pull request #9570: Add checksum for file download in test_consistency

anirudh2290 commented on a change in pull request #9570: Add checksum for file download in test_consistency
URL: https://github.com/apache/incubator-mxnet/pull/9570#discussion_r164213011
 
 

 ##########
 File path: tests/python/gpu/test_forward.py
 ##########
 @@ -41,8 +42,19 @@ def _dump_images(shape):
     np.save('data/test_images_%d_%d.npy'%shape, imgs)
 
 def _get_data(shape):
-    download("http://data.mxnet.io/data/test_images_%d_%d.npy" % (shape), dirname='data')
-    download("http://data.mxnet.io/data/inception-v3-dump.npz", dirname="data")
+    hash_test_img = "355e15800642286e7fe607d87c38aeeab085b0cc"
+    hash_inception_v3 = "91807dfdbd336eb3b265dd62c2408882462752b9"
+    fname = utils.download("http://data.mxnet.io/data/test_images_%d_%d.npy" % (shape),
+                           path="data/test_images_%d_%d.npy" % (shape),
+                           sha1_hash=hash_test_img)
+    if not utils.check_sha1(fname, hash_test_img):
+        raise RuntimeError("File %s not downloaded completely" % ("test_images_%d_%d.npy"%(shape)))
+
+    fname = utils.download("http://data.mxnet.io/data/inception-v3-dump.npz",
+                           path='data/inception-v3-dump.npz',
+                           sha1_hash=hash_inception_v3)
+    if not utils.check_sha1(fname, hash_inception_v3):
+        raise RuntimeError("File %s not downloaded completely" % ("inception-v3-dump.npz"))
 
 Review comment:
   Yes I am aware of the check. It still raises a userwarning and not an exception. In this case we are raising a RuntimeError for the test so that it doesn't fail with an unrelated message later.

----------------------------------------------------------------
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