Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop Le Cun MNIST mirror and resolve network issue #551

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions colabs/intro/Intro_to_Weights_&_Biases.ipynb
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/wandb/examples/blob/add-core-to-examples/colabs/intro/Intro_to_Weights_%26_Biases.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -104,7 +94,7 @@
"# Log in to your W&B account\n",
"import wandb\n",
"\n",
"# Use wandb-core, temporary for wandb's new backend \n",
"# Use wandb-core, temporary for wandb's new backend\n",
"wandb.require(\"core\")"
]
},
Expand Down Expand Up @@ -199,7 +189,7 @@
"[hyperparameters](https://docs.wandb.ai/ref/app/pages/run-page#overview-tab),\n",
"[terminal output](https://docs.wandb.ai/ref/app/pages/run-page#logs-tab) and\n",
"you'll see an [interactive table](https://docs.wandb.ai/guides/data-vis)\n",
"with model inputs and outputs. \n",
"with model inputs and outputs.\n",
"\n",
"This code will also save and upload Model checkpoints to W&B where you can then use them in the [W&B Registry](https://docs.wandb.ai/guides/registry)"
]
Expand Down Expand Up @@ -227,13 +217,16 @@
"import random\n",
"import torch, torchvision\n",
"import torch.nn as nn\n",
"from torchvision.datasets import MNIST\n",
"import torchvision.transforms as T\n",
"\n",
"MNIST.mirrors = [mirror for mirror in MNIST.mirrors if \"http://yann.lecun.com/\" not in mirror]\n",
"\n",
"device = \"cuda:0\" if torch.cuda.is_available() else \"cpu\"\n",
"\n",
"def get_dataloader(is_train, batch_size, slice=5):\n",
" \"Get a training dataloader\"\n",
" full_dataset = torchvision.datasets.MNIST(root=\".\", train=is_train, transform=T.ToTensor(), download=True)\n",
" full_dataset = MNIST(root=\".\", train=is_train, transform=T.ToTensor(), download=True)\n",
" sub_dataset = torch.utils.data.Subset(full_dataset, indices=range(0, len(full_dataset), slice))\n",
" loader = torch.utils.data.DataLoader(dataset=sub_dataset,\n",
" batch_size=batch_size,\n",
Expand Down Expand Up @@ -456,7 +449,6 @@
"metadata": {
"accelerator": "GPU",
"colab": {
"include_colab_link": true,
"provenance": [],
"toc_visible": true
},
Expand All @@ -467,4 +459,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
Loading