{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":3649,"databundleVersionId":46718,"sourceType":"competition"}],"dockerImageVersionId":30787,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-10-16T15:59:48.632206Z","iopub.execute_input":"2024-10-16T15:59:48.633122Z","iopub.status.idle":"2024-10-16T15:59:48.645098Z","shell.execute_reply.started":"2024-10-16T15:59:48.633079Z","shell.execute_reply":"2024-10-16T15:59:48.644103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install py7zr","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:09:08.631966Z","iopub.execute_input":"2024-10-16T16:09:08.632384Z","iopub.status.idle":"2024-10-16T16:09:22.637603Z","shell.execute_reply.started":"2024-10-16T16:09:08.632346Z","shell.execute_reply":"2024-10-16T16:09:22.636574Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pip install -U albumentations","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:13:28.122806Z","iopub.execute_input":"2024-10-16T16:13:28.123500Z","iopub.status.idle":"2024-10-16T16:13:40.106563Z","shell.execute_reply.started":"2024-10-16T16:13:28.123458Z","shell.execute_reply":"2024-10-16T16:13:40.105333Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nimport py7zr\nimport torch\nimport torch.nn.functional as F\nfrom torch.optim import AdamW\nimport math\nimport torch.nn as nn\nimport numpy as np\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import random_split, DataLoader\nimport albumentations as A\nfrom albumentations.pytorch import ToTensorV2\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import DataLoader\nfrom PIL import Image","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:13:44.981082Z","iopub.execute_input":"2024-10-16T16:13:44.982065Z","iopub.status.idle":"2024-10-16T16:13:44.989278Z","shell.execute_reply.started":"2024-10-16T16:13:44.982021Z","shell.execute_reply":"2024-10-16T16:13:44.988079Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Paths to the extracted files \ntrain_archive_path = '/kaggle/input/cifar-10/train.7z'\ntest_archive_path = '/kaggle/input/cifar-10/test.7z'\nextracted_train_path = '/kaggle/working/cifar-10/train'\nextracted_test_path = '/kaggle/working/cifar-10/test'\n\n# Extracting train and test archives\nimport py7zr\nwith py7zr.SevenZipFile(train_archive_path, mode='r') as z:\n    z.extractall(path=extracted_train_path)\n\nwith py7zr.SevenZipFile(test_archive_path, mode='r') as z:\n    z.extractall(path=extracted_test_path)\n\n# Define transformations for training, validation and test sets\ntrain_transforms = transforms.Compose([\n    transforms.RandomHorizontalFlip(),\n    transforms.RandomCrop(32, padding=4),\n    transforms.ToTensor(),\n    transforms.Normalize((0.4914, 0.4822, 0.4465), (0.247, 0.243, 0.261))\n])\n\ntest_transforms = transforms.Compose([\n    transforms.ToTensor(),\n    transforms.Normalize((0.4914, 0.4822, 0.4465), (0.247, 0.243, 0.261))\n])\n\n# Download the CIFAR-10 dataset (for training and validation)\ntrain_dataset = datasets.CIFAR10(root='./data', train=True, download=True, transform=train_transforms)\ntest_dataset = datasets.CIFAR10(root='./data', train=False, download=True, transform=test_transforms)\n\n# Split the training dataset into training (50k) and validation (10k)\ntrain_ds, val_ds = random_split(train_dataset, [45000, 5000])\nval_ds = datasets.CIFAR10(root='./data', train=False, transform=test_transforms) # Validation is CIFAR-10 test set\n\n# Creating DataLoaders\nbatch_size = 256\n\ntrain_dl = DataLoader(train_ds, batch_size=batch_size, shuffle=True, num_workers=4, pin_memory=True)\nval_dl = DataLoader(val_ds, batch_size=batch_size, shuffle=False, num_workers=4, pin_memory=True)","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:14:37.412674Z","iopub.execute_input":"2024-10-16T16:14:37.413061Z","iopub.status.idle":"2024-10-16T16:17:35.507946Z","shell.execute_reply.started":"2024-10-16T16:14:37.413026Z","shell.execute_reply":"2024-10-16T16:17:35.506971Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Function to count the number of images in a directory\ndef count_images_in_directory(directory):\n    image_count = 0\n    for root, dirs, files in os.walk(directory):\n        image_count += len([f for f in files if f.endswith(('.png', '.jpg', '.jpeg'))])  # Adjust if images are in different format\n    return image_count\n\n# Count the number of images in the training and test directories\nnum_train_images = count_images_in_directory(extracted_train_path)\nnum_test_images = count_images_in_directory(extracted_test_path)\n","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:17:58.300771Z","iopub.execute_input":"2024-10-16T16:17:58.301501Z","iopub.status.idle":"2024-10-16T16:17:58.770564Z","shell.execute_reply.started":"2024-10-16T16:17:58.301459Z","shell.execute_reply":"2024-10-16T16:17:58.769731Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_default_device():\n    if torch.cuda.is_available():\n        return torch.device('cuda')\n    else:\n        return torch.device('cpu')\n    \ndef to_device(data, device):\n    if isinstance(data, (list,tuple)):\n        return [to_device(x, device) for x in data]\n    return data.to(device, non_blocking=True)\n\nclass DeviceDataLoader():\n    def __init__(self, dl, device):\n        self.dl = dl\n        self.device = device\n        \n    def __iter__(self):\n        for b in self.dl: \n            yield to_device(b, self.device)\n\n    def __len__(self):\n        return len(self.dl)\n    \ndevice = get_default_device()\n\ntrain_dl = DeviceDataLoader(train_dl, device)\nval_dl = DeviceDataLoader(val_dl, device)","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:19:15.207932Z","iopub.execute_input":"2024-10-16T16:19:15.208900Z","iopub.status.idle":"2024-10-16T16:19:15.216861Z","shell.execute_reply.started":"2024-10-16T16:19:15.208853Z","shell.execute_reply":"2024-10-16T16:19:15.215821Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Replace Cutout with CoarseDropout\ntrain_transforms = A.Compose([\n    A.RandomCrop(32, 32),\n    A.HorizontalFlip(),\n    A.CoarseDropout(max_holes=1, max_height=8, max_width=8, fill_value=0, min_holes=1),  # Acts as CutOut\n    A.Normalize(mean=(0.4914, 0.4822, 0.4465), std=(0.247, 0.243, 0.261)),\n    ToTensorV2(),\n])\n\nval_transforms = A.Compose([\n    A.Normalize(mean=(0.4914, 0.4822, 0.4465), std=(0.247, 0.243, 0.261)),\n    ToTensorV2(),\n])","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:19:17.624990Z","iopub.execute_input":"2024-10-16T16:19:17.625886Z","iopub.status.idle":"2024-10-16T16:19:17.634308Z","shell.execute_reply.started":"2024-10-16T16:19:17.625842Z","shell.execute_reply":"2024-10-16T16:19:17.633223Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Define the ResNet9 model\ndef conv_block(in_channels, out_channels, pool=False):\n    layers = [nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1), \n              nn.BatchNorm2d(out_channels), \n              nn.ReLU(inplace=True)]\n    if pool: layers.append(nn.MaxPool2d(2))\n    return nn.Sequential(*layers)\n\nclass ResNet9(nn.Module):\n    def __init__(self, in_channels, num_classes):\n        super().__init__()\n        \n        self.conv1 = conv_block(in_channels, 64)\n        self.conv2 = conv_block(64, 128, pool=True)\n        self.res1 = nn.Sequential(conv_block(128, 128), conv_block(128, 128))\n        \n        self.conv3 = conv_block(128, 256, pool=True)\n        self.conv4 = conv_block(256, 512, pool=True)\n        self.res2 = nn.Sequential(conv_block(512, 512), conv_block(512, 512))\n        \n        self.classifier = nn.Sequential(nn.MaxPool2d(4), \n                                        nn.Flatten(), \n                                        nn.Dropout(0.2),\n                                        nn.Linear(512, num_classes))\n        \n    def forward(self, xb):\n        out = self.conv1(xb)\n        out = self.conv2(out)\n        out = self.res1(out) + out\n        out = self.conv3(out)\n        out = self.conv4(out)\n        out = self.res2(out) + out\n        out = self.classifier(out)\n        return out\n    \n    # Define a method for the validation step\n    def validation_step(self, batch):\n        images, labels = batch\n        images, labels = images.to(device), labels.to(device)\n        out = self(images)  # Generate predictions\n        loss = F.cross_entropy(out, labels)  # Calculate loss\n        acc = accuracy(out, labels)  # Calculate accuracy\n        return {'val_loss': loss.detach(), 'val_acc': acc}\n\n    # Method to aggregate validation results at the end of each epoch\n    def validation_epoch_end(self, outputs):\n        batch_losses = [x['val_loss'] for x in outputs]\n        epoch_loss = torch.stack(batch_losses).mean()  # Calculate average loss\n        batch_accs = [x['val_acc'] for x in outputs]\n        epoch_acc = torch.stack(batch_accs).mean()  # Calculate average accuracy\n        return {'val_loss': epoch_loss.item(), 'val_acc': epoch_acc.item()}\n\n    # Method to print epoch results\n    def epoch_end(self, epoch, result):\n        print(f\"Epoch [{epoch+1}], train_loss: {result['train_loss']:.4f}, \"\n              f\"val_loss: {result['val_loss']:.4f}, val_acc: {result['val_acc']:.4f}\")\n\n# Instantiate the model (CIFAR-10 has 3 input channels and 10 output classes)\nmodel = ResNet9(3, 10)\n\n# Move the model to the appropriate device (GPU if available)\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\nmodel = model.to(device)\n\n# Function to generate random bounding box for CutMix\ndef rand_bbox(size, lam):\n    W = size[2]\n    H = size[3]\n    cut_rat = np.sqrt(1. - lam)\n    cut_w = int(W * cut_rat)  # Replace np.int with int\n    cut_h = int(H * cut_rat)  # Replace np.int with int\n\n    # Uniformly sample the center of the bounding box\n    cx = np.random.randint(W)\n    cy = np.random.randint(H)\n\n    # Calculate the coordinates of the bounding box\n    bbx1 = np.clip(cx - cut_w // 2, 0, W)\n    bby1 = np.clip(cy - cut_h // 2, 0, H)\n    bbx2 = np.clip(cx + cut_w // 2, 0, W)\n    bby2 = np.clip(cy + cut_h // 2, 0, H)\n\n    return bbx1, bby1, bbx2, bby2\n\n# CutMix function\ndef cutmix_data(x, y, alpha=1.0):\n    lam = np.random.beta(alpha, alpha)\n    rand_index = torch.randperm(x.size()[0]).to(x.device)\n    target_a = y\n    target_b = y[rand_index]\n    \n    # Generate random bounding box\n    bbx1, bby1, bbx2, bby2 = rand_bbox(x.size(), lam)\n    \n    # Apply CutMix to the images\n    x[:, :, bbx1:bbx2, bby1:bby2] = x[rand_index, :, bbx1:bbx2, bby1:bby2]\n    \n    # Adjust lambda based on the actual area of the cut\n    lam = 1 - ((bbx2 - bbx1) * (bby2 - bby1) / (x.size()[-1] * x.size()[-2]))\n    \n    return x, target_a, target_b, lam\n\n# Cosine annealing with warmup\ndef cosine_annealing_warmup(optimizer, total_steps, warmup_steps, min_lr):\n    def lr_lambda(current_step):\n        if current_step < warmup_steps:\n            return float(current_step) / float(max(1, warmup_steps))\n        return max(min_lr, 0.5 * (1 + math.cos(math.pi * (current_step - warmup_steps) / (total_steps - warmup_steps))))\n    \n    scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer, lr_lambda)\n    return scheduler\n\n# Training step with CutMix\ndef training_step_with_cutmix(batch, model, optimizer, scheduler, grad_clip=None):\n    images, labels = batch\n    images, labels_a, labels_b, lam = cutmix_data(images, labels)\n    \n    optimizer.zero_grad()\n    outputs = model(images)\n    loss = lam * F.cross_entropy(outputs, labels_a) + (1 - lam) * F.cross_entropy(outputs, labels_b)\n    \n    loss.backward()\n    \n    if grad_clip:  # Gradient clipping\n        torch.nn.utils.clip_grad_value_(model.parameters(), grad_clip)\n    \n    optimizer.step()\n    scheduler.step()\n    \n    return loss.item()\n\n# Helper function to calculate accuracy\ndef accuracy(outputs, labels):\n    _, preds = torch.max(outputs, dim=1)\n    return torch.tensor(torch.sum(preds == labels).item() / len(preds))\n\n# Function to get the current learning rate from the optimizer\ndef get_lr(optimizer):\n    for param_group in optimizer.param_groups:\n        return param_group['lr']\n\n# Training function with learning rate tracking and weight decay\ndef fit_one_cycle(epochs, max_lr, model, train_dl, val_dl, grad_clip=None, weight_decay=1e-4, opt_func=AdamW):\n    history = []\n    total_steps = epochs * len(train_dl)\n    optimizer = opt_func(model.parameters(), lr=max_lr, weight_decay=weight_decay)  # Weight decay is added here\n    scheduler = cosine_annealing_warmup(optimizer, total_steps, warmup_steps=0.1 * total_steps, min_lr=1e-5)\n    \n    for epoch in range(epochs):\n        model.train()\n        train_losses = []\n        lrs = []  # Track learning rates\n        \n        for batch in train_dl:\n            loss = training_step_with_cutmix(batch, model, optimizer, scheduler, grad_clip)\n            train_losses.append(loss)\n            \n            # Track the learning rate\n            lr = get_lr(optimizer)\n            lrs.append(lr)\n        \n        # Validation step (no CutMix)\n        result = evaluate(model, val_dl)\n        result['train_loss'] = torch.tensor(train_losses).mean().item()\n        result['lrs'] = lrs  # Store learning rates for logging\n        model.epoch_end(epoch, result)\n        history.append(result)\n    \n    return history\n\n# Evaluate the model on the validation set\n@torch.no_grad()\ndef evaluate(model, val_dl):\n    model.eval()\n    outputs = [model.validation_step(batch) for batch in val_dl]\n    return model.validation_epoch_end(outputs)\n\n# Define training settings\nepochs = 120\nmax_lr = 0.01\ngrad_clip = 0.1\nweight_decay = 1e-4  # You can adjust this value\n\n# Start training with CutMix, Cosine Annealing, AdamW optimizer, and weight decay\nhistory = fit_one_cycle(epochs, max_lr, model, train_dl, val_dl, grad_clip=grad_clip, weight_decay=weight_decay, opt_func=AdamW)","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:21:50.621747Z","iopub.execute_input":"2024-10-16T16:21:50.622158Z","iopub.status.idle":"2024-10-16T16:49:45.593462Z","shell.execute_reply.started":"2024-10-16T16:21:50.622119Z","shell.execute_reply":"2024-10-16T16:49:45.592198Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Evaluate the model on the validation set\n@torch.no_grad()\ndef evaluate(model, val_dl):\n    model.eval()\n    val_loss = 0\n    correct_predictions = 0\n    total_predictions = 0\n    \n    for batch in val_dl:\n        images, labels = batch\n        images, labels = images.to(device), labels.to(device)\n        outputs = model(images)\n        loss = F.cross_entropy(outputs, labels)\n        val_loss += loss.item()\n        \n        # Get predicted class labels\n        _, preds = torch.max(outputs, dim=1)\n        correct_predictions += torch.sum(preds == labels).item()\n        total_predictions += len(labels)\n    \n    accuracy = correct_predictions / total_predictions\n    avg_val_loss = val_loss / len(val_dl)\n    \n    return {'val_loss': avg_val_loss, 'val_acc': accuracy}\n\n# After training is done, print accuracy on the validation set\nval_result = evaluate(model, val_dl)\nprint(f\"Validation Loss: {val_result['val_loss']:.4f}, Validation Accuracy: {val_result['val_acc']:.4f}\")","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:51:51.829428Z","iopub.execute_input":"2024-10-16T16:51:51.829904Z","iopub.status.idle":"2024-10-16T16:51:53.580207Z","shell.execute_reply.started":"2024-10-16T16:51:51.829864Z","shell.execute_reply":"2024-10-16T16:51:53.579144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# List the contents of the working directory\nworking_dir = '/kaggle/working/'\ninput_dir = '/kaggle/input/'\n\n# List the files in the input directory (which should contain your dataset)\nprint(f\"Contents of {input_dir}:\")\nfor root, dirs, files in os.walk(input_dir):\n    for name in dirs:\n        print(os.path.join(root, name))","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:54:42.330226Z","iopub.execute_input":"2024-10-16T16:54:42.331143Z","iopub.status.idle":"2024-10-16T16:54:42.346060Z","shell.execute_reply.started":"2024-10-16T16:54:42.331101Z","shell.execute_reply":"2024-10-16T16:54:42.345163Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# Define transformations (same as your training/validation transformations)\ntest_transforms = transforms.Compose([\n    transforms.ToTensor(),\n    transforms.Normalize((0.4914, 0.4822, 0.4465), (0.247, 0.243, 0.261))\n])\n\n# Custom Dataset for loading test images from a folder\nclass CustomImageDataset(torch.utils.data.Dataset):\n    def __init__(self, image_paths, transform=None):\n        self.image_paths = image_paths\n        self.transform = transform\n\n    def __len__(self):\n        return len(self.image_paths)\n\n    def __getitem__(self, idx):\n        img_path = self.image_paths[idx]\n        image = Image.open(img_path)\n        if self.transform:\n            image = self.transform(image)\n        return image\n\n# Define the test directory (replace this with your actual path)\ntest_directory = '/kaggle/working/cifar-10/test/test'  # Adjust this path based on your test directory\n\n# Filter to include only files with image extensions (e.g., .png, .jpg, .jpeg)\nvalid_image_extensions = ['.png', '.jpg', '.jpeg']  # Add other extensions as needed\ntest_images = [os.path.join(test_directory, img) for img in os.listdir(test_directory)\n               if os.path.isfile(os.path.join(test_directory, img)) and img.lower().endswith(tuple(valid_image_extensions))]\n\n# Check if the filtered list is valid\nprint(f\"Number of valid test images found: {len(test_images)}\")\n\n# Get a list of test image paths\ntest_images = [os.path.join(test_directory, img) for img in os.listdir(test_directory)]\n\n# Create a DataLoader for the test set\ntest_dataset = CustomImageDataset(test_images, transform=test_transforms)\ntest_dl = DataLoader(test_dataset, batch_size=256, shuffle=False, num_workers=4)","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:54:46.675230Z","iopub.execute_input":"2024-10-16T16:54:46.675641Z","iopub.status.idle":"2024-10-16T16:54:50.388629Z","shell.execute_reply.started":"2024-10-16T16:54:46.675599Z","shell.execute_reply":"2024-10-16T16:54:50.387589Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"@torch.no_grad()\ndef generate_predictions(model, test_dl):\n    model.eval()\n    predictions = []\n    \n    for images in test_dl:  # No labels in the test set\n        images = images.to(device)\n        outputs = model(images)\n        _, preds = torch.max(outputs, dim=1)  # Get the predicted class indices\n        predictions.extend(preds.cpu().numpy())  # Collect predictions\n    \n    return predictions\n\n# Generate predictions\npredictions = generate_predictions(model, test_dl)","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:54:55.857809Z","iopub.execute_input":"2024-10-16T16:54:55.858425Z","iopub.status.idle":"2024-10-16T16:56:00.717705Z","shell.execute_reply.started":"2024-10-16T16:54:55.858370Z","shell.execute_reply":"2024-10-16T16:56:00.716432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# CIFAR-10 label names\ncifar10_labels = {\n    0: 'airplane',\n    1: 'automobile',\n    2: 'bird',\n    3: 'cat',\n    4: 'deer',\n    5: 'dog',\n    6: 'frog',\n    7: 'horse',\n    8: 'ship',\n    9: 'truck'\n}\n\n# Map the numeric predictions to class names\npredicted_labels = [cifar10_labels[p] for p in predictions]\n\n# Assuming the images are named like '1.png', '2.png', etc.\nimage_ids = [os.path.splitext(img)[0] for img in os.listdir(test_directory)]\n\n# Create a DataFrame for the submission\nsubmission_df = pd.DataFrame({\n    'id': image_ids,         # Image IDs (based on filenames)\n    'label': predicted_labels  # Predicted class names\n})\n\n# Define the path to save the CSV file\nsubmission_file_path = '/kaggle/working/submission.csv'\n\n# Save to a CSV file\nsubmission_df.to_csv(submission_file_path, index=False)\n\n# Confirm that the file is created\nprint(f\"Submission file created at: {submission_file_path}\")\n\n# Check the number of rows in the submission file\nnum_rows = submission_df.shape[0]\nprint(f\"Number of rows in the submission file: {num_rows}\")\n\n# Verify that the file contains the correct number of rows (should be 300,000 if applicable)\nif num_rows == 300000:\n    print(\"The submission file contains 300,000 rows, as expected.\")\nelse:\n    print(f\"Warning: The submission file contains {num_rows} rows instead of 300,000.\")","metadata":{"execution":{"iopub.status.busy":"2024-10-16T16:57:06.058804Z","iopub.execute_input":"2024-10-16T16:57:06.059680Z","iopub.status.idle":"2024-10-16T16:57:07.241415Z","shell.execute_reply.started":"2024-10-16T16:57:06.059636Z","shell.execute_reply":"2024-10-16T16:57:07.240452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}