Learn practical skills, build real-world projects, and advance your career
import torchvision
import torch
from torchvision import transforms, datasets
import matplotlib.pyplot as plt
%matplotlib inline
train = datasets.MNIST('', train= True, download= True, transform= transforms.Compose([transforms.ToTensor()]))
test = datasets.MNIST('', train= False, download= True, transform= transforms.Compose([transforms.ToTensor()]))
Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to MNIST\raw\train-images-idx3-ubyte.gz
HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))
Extracting MNIST\raw\train-images-idx3-ubyte.gz to MNIST\raw Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to MNIST\raw\train-labels-idx1-ubyte.gz
HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))
Extracting MNIST\raw\train-labels-idx1-ubyte.gz to MNIST\raw Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to MNIST\raw\t10k-images-idx3-ubyte.gz
HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))
Extracting MNIST\raw\t10k-images-idx3-ubyte.gz to MNIST\raw Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to MNIST\raw\t10k-labels-idx1-ubyte.gz
HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))
Extracting MNIST\raw\t10k-labels-idx1-ubyte.gz to MNIST\raw Processing...
C:\ProgramData\Anaconda3\lib\site-packages\torchvision\datasets\mnist.py:480: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:141.) return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
Done!
!pip install jovian --upgrade
Collecting jovian Using cached https://files.pythonhosted.org/packages/b5/4f/518848f2410b6f506a8f1fb3a088a9d5fc3d2e2681332f04f9fe847a7e97/jovian-0.2.26-py2.py3-none-any.whl Requirement already satisfied, skipping upgrade: click in c:\programdata\anaconda3\lib\site-packages (from jovian) (7.0) Requirement already satisfied, skipping upgrade: requests in c:\programdata\anaconda3\lib\site-packages (from jovian) (2.22.0) Requirement already satisfied, skipping upgrade: pyyaml in c:\programdata\anaconda3\lib\site-packages (from jovian) (5.1.2) Collecting uuid (from jovian) Using cached https://files.pythonhosted.org/packages/ce/63/f42f5aa951ebf2c8dac81f77a8edcc1c218640a2a35a03b9ff2d4aa64c3d/uuid-1.30.tar.gz Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in c:\programdata\anaconda3\lib\site-packages (from requests->jovian) (3.0.4) Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in c:\programdata\anaconda3\lib\site-packages (from requests->jovian) (2.8) Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in c:\programdata\anaconda3\lib\site-packages (from requests->jovian) (2019.9.11) Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\programdata\anaconda3\lib\site-packages (from requests->jovian) (1.24.2) Building wheels for collected packages: uuid Building wheel for uuid (setup.py): started Building wheel for uuid (setup.py): finished with status 'done' Created wheel for uuid: filename=uuid-1.30-cp37-none-any.whl size=6506 sha256=ddc24817f6e9f438435a519f3d0fee37cd711c80782c2623d1e0dcb8c30b63e1 Stored in directory: C:\Users\LENOVO\AppData\Local\pip\Cache\wheels\2a\80\9b\015026567c29fdffe31d91edbe7ba1b17728db79194fca1f21 Successfully built uuid Installing collected packages: uuid, jovian Successfully installed jovian-0.2.26 uuid-1.30
import jovian
jovian.commit()
[jovian] Attempting to save notebook.. [jovian] Please enter your API key ( from https://jovian.ai/ ): API KEY: