Skip to content

Commit

Permalink
fix MNIST download failure with torchvision in sagemaker-experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
alar0330 committed Mar 21, 2021
1 parent 0be61e6 commit cbd3704
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@
"metadata": {},
"outputs": [],
"source": [
"# TODO: can be removed after upgrade to torchvision==0.9.1\n",
"# see github.com/pytorch/vision/issues/1938 and github.com/pytorch/vision/issues/3549\n",
"datasets.MNIST.urls = [\n",
" 'https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz',\n",
" 'https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz',\n",
" 'https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz',\n",
" 'https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz'\n",
"]\n",
"\n",
"# download the dataset\n",
"# this will not only download data to ./mnist folder, but also load and transform (normalize) them\n",
"train_set = datasets.MNIST('mnist', train=True, transform=transforms.Compose([\n",
Expand Down Expand Up @@ -529,9 +538,9 @@
"metadata": {
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science)",
"display_name": "Python 3",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-east-2:429704687514:environment/datascience"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -543,7 +552,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit cbd3704

Please sign in to comment.