{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "gpuType": "T4" }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" }, "accelerator": "GPU", "widgets": { "application/vnd.jupyter.widget-state+json": { "712ce69edaac4f628fd9dfd76b53eac4": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_36c6e1df7117444ebd530aec4bb0dacb", "IPY_MODEL_5bce52370cd641d5a9bd5cc1459b5a7b", "IPY_MODEL_082b691403a34f15bbe062d8f4d21c17" ], "layout": "IPY_MODEL_2320ec3596e546709f8c9ee73ce07548" } }, "36c6e1df7117444ebd530aec4bb0dacb": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c7e2d4daa56a48d79869bf0fadb7a34d", "placeholder": "​", "style": "IPY_MODEL_c011b5895afb48729adeb0be47cc08f4", "value": "efficientnet_gps_regressor_complete.pth: 100%" } }, "5bce52370cd641d5a9bd5cc1459b5a7b": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_ac49064e71784748b40ab9b44658426f", "max": 16408050, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_1dbbb0a6dba643dd83f5bfaad552dcd7", "value": 16408050 } }, "082b691403a34f15bbe062d8f4d21c17": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_16b552f5d27741fbb8f8a284039b05b2", "placeholder": "​", "style": "IPY_MODEL_78c682f5754b4a35b5461cc59cb0c218", "value": " 16.4M/16.4M [00:00<00:00, 30.0MB/s]" } }, "2320ec3596e546709f8c9ee73ce07548": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "c7e2d4daa56a48d79869bf0fadb7a34d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "c011b5895afb48729adeb0be47cc08f4": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "ac49064e71784748b40ab9b44658426f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "1dbbb0a6dba643dd83f5bfaad552dcd7": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "16b552f5d27741fbb8f8a284039b05b2": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "78c682f5754b4a35b5461cc59cb0c218": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } } } } }, "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "uoEz8DyTYUts", "outputId": "762f8194-bb68-4641-fd00-30ef770fdaa3" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Collecting datasets\n", " Downloading datasets-3.2.0-py3-none-any.whl.metadata (20 kB)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from datasets) (3.16.1)\n", "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from datasets) (1.26.4)\n", "Requirement already satisfied: pyarrow>=15.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (17.0.0)\n", "Collecting dill<0.3.9,>=0.3.0 (from datasets)\n", " Downloading dill-0.3.8-py3-none-any.whl.metadata (10 kB)\n", "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets) (2.2.2)\n", "Requirement already satisfied: requests>=2.32.2 in /usr/local/lib/python3.10/dist-packages (from datasets) (2.32.3)\n", "Requirement already satisfied: tqdm>=4.66.3 in /usr/local/lib/python3.10/dist-packages (from datasets) (4.66.6)\n", "Collecting xxhash (from datasets)\n", " Downloading xxhash-3.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", "Collecting multiprocess<0.70.17 (from datasets)\n", " Downloading multiprocess-0.70.16-py310-none-any.whl.metadata (7.2 kB)\n", "Collecting fsspec<=2024.9.0,>=2023.1.0 (from fsspec[http]<=2024.9.0,>=2023.1.0->datasets)\n", " Downloading fsspec-2024.9.0-py3-none-any.whl.metadata (11 kB)\n", "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets) (3.11.10)\n", "Requirement already satisfied: huggingface-hub>=0.23.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.26.5)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from datasets) (24.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (6.0.2)\n", "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (2.4.4)\n", "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.3.1)\n", "Requirement already satisfied: async-timeout<6.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (4.0.3)\n", "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (24.2.0)\n", "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.5.0)\n", "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (6.1.0)\n", "Requirement already satisfied: propcache>=0.2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (0.2.1)\n", "Requirement already satisfied: yarl<2.0,>=1.17.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.18.3)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.23.0->datasets) (4.12.2)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (3.4.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (3.10)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (2.2.3)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (2024.8.30)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2.8.2)\n", "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2024.2)\n", "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2024.2)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->datasets) (1.17.0)\n", "Downloading datasets-3.2.0-py3-none-any.whl (480 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m480.6/480.6 kB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading dill-0.3.8-py3-none-any.whl (116 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m116.3/116.3 kB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading fsspec-2024.9.0-py3-none-any.whl (179 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m179.3/179.3 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading multiprocess-0.70.16-py310-none-any.whl (134 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m9.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading xxhash-3.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m194.1/194.1 kB\u001b[0m \u001b[31m8.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: xxhash, fsspec, dill, multiprocess, datasets\n", " Attempting uninstall: fsspec\n", " Found existing installation: fsspec 2024.10.0\n", " Uninstalling fsspec-2024.10.0:\n", " Successfully uninstalled fsspec-2024.10.0\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "gcsfs 2024.10.0 requires fsspec==2024.10.0, but you have fsspec 2024.9.0 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed datasets-3.2.0 dill-0.3.8 fsspec-2024.9.0 multiprocess-0.70.16 xxhash-3.5.0\n" ] } ], "source": [ "!pip install datasets" ] }, { "cell_type": "code", "source": [ "!pip install huggingface_hub" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "pnoqloVaYcZc", "outputId": "2813901c-8723-4283-bc91-cf1f55c79f9e" }, "execution_count": 2, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: huggingface_hub in /usr/local/lib/python3.10/dist-packages (0.26.5)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from huggingface_hub) (3.16.1)\n", "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from huggingface_hub) (2024.9.0)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.10/dist-packages (from huggingface_hub) (24.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from huggingface_hub) (6.0.2)\n", "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from huggingface_hub) (2.32.3)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.10/dist-packages (from huggingface_hub) (4.66.6)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface_hub) (4.12.2)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface_hub) (3.4.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface_hub) (3.10)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface_hub) (2.2.3)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface_hub) (2024.8.30)\n" ] } ] }, { "cell_type": "code", "source": [ "!pip install requests" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "AV0maTmHY-ub", "outputId": "b0185659-6307-40b5-a3af-e16483006fce" }, "execution_count": 3, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (2.32.3)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests) (3.4.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests) (3.10)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests) (2.2.3)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests) (2024.8.30)\n" ] } ] }, { "cell_type": "code", "source": [ "import torch\n", "import torch.nn as nn\n", "import torch.optim as optim\n", "from torchvision.models import efficientnet_b0\n", "from torch.optim.lr_scheduler import CosineAnnealingLR\n", "from torchvision import transforms\n", "from torch.utils.data import DataLoader, Dataset\n", "from torchvision.transforms import functional as F\n", "from PIL import Image\n", "import numpy as np\n", "from sklearn.metrics import mean_absolute_error, mean_squared_error\n", "from huggingface_hub import PyTorchModelHubMixin\n", "import os\n", "\n", "\n", "# Model Definition\n", "class CustomGPSModel(nn.Module):\n", " def __init__(self):\n", " super(CustomGPSModel, self).__init__()\n", "\n", " # Load EfficientNet-B0 with pretrained weights\n", " self.efficientnet = efficientnet_b0(pretrained=True)\n", "\n", " # Modify the final layer for regression (predicting latitude and longitude)\n", " num_features = self.efficientnet.classifier[1].in_features\n", " self.efficientnet.classifier[1] = nn.Linear(num_features, 2) # Output layer has 2 outputs for latitude & longitude\n", "\n", " # Freeze earlier layers except the last few\n", " for param in self.efficientnet.features.parameters():\n", " param.requires_grad = True\n", "\n", " def forward(self, x):\n", " return self.efficientnet(x) # Forward pass through EfficientNet" ], "metadata": { "id": "uBlw8T7r-EmY" }, "execution_count": 4, "outputs": [] }, { "cell_type": "code", "source": [ "from huggingface_hub import hf_hub_download\n", "import torch\n", "\n", "path_name = \"efficientnet_gps_regressor_complete.pth\"\n", "repo_name = \"CustomGPSModel_EfficientNetB0_Run2\"\n", "organization_name = \"LAJ-519-Image-Project\"\n", "\n", "# Specify the repository and the filename of the model you want to load\n", "repo_id = f\"{organization_name}/{repo_name}\"\n", "filename = f\"{path_name}\"\n", "\n", "model_path = hf_hub_download(repo_id=repo_id, filename=filename)\n", "\n", "# Load the model using torch\n", "model_test = torch.load(model_path)\n", "model_test.eval()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000, "referenced_widgets": [ "712ce69edaac4f628fd9dfd76b53eac4", "36c6e1df7117444ebd530aec4bb0dacb", "5bce52370cd641d5a9bd5cc1459b5a7b", "082b691403a34f15bbe062d8f4d21c17", "2320ec3596e546709f8c9ee73ce07548", "c7e2d4daa56a48d79869bf0fadb7a34d", "c011b5895afb48729adeb0be47cc08f4", "ac49064e71784748b40ab9b44658426f", "1dbbb0a6dba643dd83f5bfaad552dcd7", "16b552f5d27741fbb8f8a284039b05b2", "78c682f5754b4a35b5461cc59cb0c218" ] }, "id": "eVrRN-sKZQbq", "outputId": "35115c5d-2a11-4b26-9523-ae769cf2fd7d" }, "execution_count": 5, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning: \n", "The secret `HF_TOKEN` does not exist in your Colab secrets.\n", "To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co./settings/tokens), set it as secret in your Google Colab and restart your session.\n", "You will be able to reuse this secret in all of your notebooks.\n", "Please note that authentication is recommended but still optional to access public models or datasets.\n", " warnings.warn(\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "efficientnet_gps_regressor_complete.pth: 0%| | 0.00/16.4M [00:00:15: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n", " model_test = torch.load(model_path)\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [ "CustomGPSModel(\n", " (efficientnet): EfficientNet(\n", " (features): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)\n", " (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Sequential(\n", " (0): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=32, bias=False)\n", " (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(32, 8, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(8, 32, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (2): Conv2dNormActivation(\n", " (0): Conv2d(32, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.0, mode=row)\n", " )\n", " )\n", " (2): Sequential(\n", " (0): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(16, 96, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(96, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(96, 96, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=96, bias=False)\n", " (1): BatchNorm2d(96, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(96, 4, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(4, 96, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(96, 24, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(24, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.0125, mode=row)\n", " )\n", " (1): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(24, 144, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(144, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(144, 144, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=144, bias=False)\n", " (1): BatchNorm2d(144, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(144, 6, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(6, 144, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(144, 24, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(24, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.025, mode=row)\n", " )\n", " )\n", " (3): Sequential(\n", " (0): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(24, 144, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(144, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(144, 144, kernel_size=(5, 5), stride=(2, 2), padding=(2, 2), groups=144, bias=False)\n", " (1): BatchNorm2d(144, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(144, 6, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(6, 144, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(144, 40, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(40, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.037500000000000006, mode=row)\n", " )\n", " (1): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(40, 240, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(240, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(240, 240, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=240, bias=False)\n", " (1): BatchNorm2d(240, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(240, 10, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(10, 240, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(240, 40, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(40, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.05, mode=row)\n", " )\n", " )\n", " (4): Sequential(\n", " (0): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(40, 240, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(240, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(240, 240, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=240, bias=False)\n", " (1): BatchNorm2d(240, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(240, 10, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(10, 240, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(240, 80, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(80, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.0625, mode=row)\n", " )\n", " (1): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(80, 480, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(480, 480, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=480, bias=False)\n", " (1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(480, 20, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(20, 480, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(480, 80, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(80, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.07500000000000001, mode=row)\n", " )\n", " (2): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(80, 480, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(480, 480, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=480, bias=False)\n", " (1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(480, 20, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(20, 480, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(480, 80, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(80, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.08750000000000001, mode=row)\n", " )\n", " )\n", " (5): Sequential(\n", " (0): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(80, 480, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(480, 480, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=480, bias=False)\n", " (1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(480, 20, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(20, 480, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(480, 112, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(112, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.1, mode=row)\n", " )\n", " (1): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(112, 672, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(672, 672, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=672, bias=False)\n", " (1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(672, 28, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(28, 672, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(672, 112, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(112, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.1125, mode=row)\n", " )\n", " (2): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(112, 672, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(672, 672, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=672, bias=False)\n", " (1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(672, 28, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(28, 672, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(672, 112, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(112, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.125, mode=row)\n", " )\n", " )\n", " (6): Sequential(\n", " (0): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(112, 672, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(672, 672, kernel_size=(5, 5), stride=(2, 2), padding=(2, 2), groups=672, bias=False)\n", " (1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(672, 28, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(28, 672, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(672, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.1375, mode=row)\n", " )\n", " (1): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(192, 1152, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(1152, 1152, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=1152, bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(1152, 48, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(48, 1152, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(1152, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.15000000000000002, mode=row)\n", " )\n", " (2): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(192, 1152, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(1152, 1152, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=1152, bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(1152, 48, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(48, 1152, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(1152, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.1625, mode=row)\n", " )\n", " (3): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(192, 1152, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(1152, 1152, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=1152, bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(1152, 48, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(48, 1152, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(1152, 192, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.17500000000000002, mode=row)\n", " )\n", " )\n", " (7): Sequential(\n", " (0): MBConv(\n", " (block): Sequential(\n", " (0): Conv2dNormActivation(\n", " (0): Conv2d(192, 1152, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (1): Conv2dNormActivation(\n", " (0): Conv2d(1152, 1152, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1152, bias=False)\n", " (1): BatchNorm2d(1152, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " (2): SqueezeExcitation(\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (fc1): Conv2d(1152, 48, kernel_size=(1, 1), stride=(1, 1))\n", " (fc2): Conv2d(48, 1152, kernel_size=(1, 1), stride=(1, 1))\n", " (activation): SiLU(inplace=True)\n", " (scale_activation): Sigmoid()\n", " )\n", " (3): Conv2dNormActivation(\n", " (0): Conv2d(1152, 320, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(320, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " )\n", " )\n", " (stochastic_depth): StochasticDepth(p=0.1875, mode=row)\n", " )\n", " )\n", " (8): Conv2dNormActivation(\n", " (0): Conv2d(320, 1280, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", " (1): BatchNorm2d(1280, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", " (2): SiLU(inplace=True)\n", " )\n", " )\n", " (avgpool): AdaptiveAvgPool2d(output_size=1)\n", " (classifier): Sequential(\n", " (0): Dropout(p=0.2, inplace=True)\n", " (1): Linear(in_features=1280, out_features=2, bias=True)\n", " )\n", " )\n", ")" ] }, "metadata": {}, "execution_count": 5 } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "TGNyzqg-O6R9" }, "execution_count": null, "outputs": [] } ] }