今日已更新 166 条资讯 | 累计 20138 条内容
关于我们

标签:#colab

找到 1 篇相关文章

AI 资讯

Google Colab, but in your favourite terminal

While some of my recent posts have involved using the Colab extension for VS Code and the Antigravity IDE, I actually prefer working in the terminal and Vim. The new Colab CLI finally lets me work in my natural habitat, and it opens the door for autonomous workflows! Setup Currently, installation is handled via pip or uv. It's straightforward, though, I'm holding out hope for a brew formula in the future: uv tool install google-colab-cli I'm testing Version: 0.6.dev7+g510115b0c inside Ghostty. The Colab CLI is pretty solid, but I do have some feedback and nitpicks I'd like to share (but more on that later). Creating a new session Creating a session is simple: colab new [-s SESSION_NAME] [--gpu T4|L4|A100|H100] [--tpu v5e1|v6e1] : SESSION_NAME : This is optional. If you leave it blank, the CLI generates a random unique ID for you. --gpu and --tpu : The hardware accelerator flags are optional, but omitting them defaults to a standard CPU-only instance. The specific accelerator chips you can request depend on your Colab tier, which you can check via colab pay. NOTE : If you only have one active session, the CLI targets it by default. This makes the -s flag unnecessary for subsequent commands. Testing Colab CLI's capabilities CLI certainly sounds cool, but how does it handle artifacts and images? More importantly, how debuggable is it? I decided to find out by running a Fashion MNIST PyTorch example. Handling artifacts To get started, I installed my requirements using colab install torch torchvision matplotlib . If you prefer a more standard approach, you can also use colab install -r requirements.txt . Once the environment was ready, I executed the training script using colab exec -f ./fashion_mnist_TRAIN.py and here's the output: [ colab] Using unique session '8c860c' . Using CUDA device. Shape of X [ N, C, H, W]: torch.Size ([ 64, 1, 28, 28] ) Shape of y: torch.Size ([ 64] ) torch.int64 NeuralNetwork ( ( flatten ) : Flatten ( start_dim = 1, end_dim = -1 ) ( linear_re

2026-06-06 原文 →