{
  "cells": [
    {
      "cell_type": "markdown",
      "id": "c1604535",
      "metadata": {
        "id": "c1604535"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/open-mmlab/mmselfsup/blob/master/demo/mmselfsup_colab_tutorial.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "d76e94d0",
      "metadata": {
        "id": "d76e94d0"
      },
      "source": [
        "# MMSelfSup Tutorial\n",
        "In this tutorial, we will introduce the following content:\n",
        "\n",
        "- How to install MMSelfSup\n",
        "- How to train algorithms in MMSelfSup\n",
        "- How to train downstream tasks\n",
        "\n",
        "If you have any other questions, welcome to report issues."
      ]
    },
    {
      "cell_type": "markdown",
      "id": "8159aadf",
      "metadata": {
        "id": "8159aadf"
      },
      "source": [
        "## How to install MMSelfSup\n",
        "\n",
        "Before using MMSelfSup, we need to prepare the environment with the following steps:\n",
        "\n",
        "1. Install Python, CUDA, C/C++ compiler and git\n",
        "2. Install PyTorch (CUDA version)\n",
        "3. Install dependent codebase (mmcv, mmcls)\n",
        "4. Clone mmselfsup source code from GitHub and install it\n",
        "\n",
        "Because this tutorial is on Google Colab and all necessary packages have been installed, we can skip the first two steps."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "id": "66ed8cfe",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "66ed8cfe",
        "outputId": "46f7db9f-770d-4339-aff0-d7f8f005634e"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "/content\n"
          ]
        }
      ],
      "source": [
        "!pwd"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "id": "86d5SBUQxpOm",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "86d5SBUQxpOm",
        "outputId": "c3521c08-831a-446d-fc35-d86fa89a35de"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "nvcc: NVIDIA (R) Cuda compiler driver\n",
            "Copyright (c) 2005-2020 NVIDIA Corporation\n",
            "Built on Mon_Oct_12_20:09:46_PDT_2020\n",
            "Cuda compilation tools, release 11.1, V11.1.105\n",
            "Build cuda_11.1.TC455_06.29190527_0\n"
          ]
        }
      ],
      "source": [
        "# Check nvcc version\n",
        "!nvcc -V"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "id": "rINWzY4ixpT-",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "rINWzY4ixpT-",
        "outputId": "742c399a-eee9-48d4-a0c5-c7eaf717a817"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0\n",
            "Copyright (C) 2017 Free Software Foundation, Inc.\n",
            "This is free software; see the source for copying conditions.  There is NO\n",
            "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
            "\n"
          ]
        }
      ],
      "source": [
        "# Check GCC version\n",
        "!gcc --version"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "id": "ab8155aa",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ab8155aa",
        "outputId": "64072a74-c830-4206-8b3c-9f7398d4e7a9"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "1.10.0+cu111\n",
            "True\n"
          ]
        }
      ],
      "source": [
        "# Check PyTorch installation\n",
        "import torch, torchvision\n",
        "print(torch.__version__)\n",
        "print(torch.cuda.is_available())"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "18aad462",
      "metadata": {
        "id": "18aad462"
      },
      "source": [
        "## Install MMCV\n",
        "\n",
        "MMCV is the basic package of all OpenMMLab packages. We have pre-built wheels on Linux, so we can download and install them directly.\n",
        "\n",
        "Please pay attention to PyTorch and CUDA versions to match the wheel.\n",
        "\n",
        "In the above steps, we have checked the version of PyTorch and CUDA, and they are 1.10.2 and 11.3 respectively, so we need to choose the corresponding wheel.\n",
        "\n",
        "In addition, we can also install the full version of mmcv (mmcv-full). It includes full features and various CUDA ops out of the box, but needs a longer time to build."
      ]
    },
    {
      "cell_type": "markdown",
      "id": "89532489",
      "metadata": {
        "id": "89532489"
      },
      "source": [
        "MIM is recommended: https://github.com/open-mmlab/mim"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "id": "fb3da020",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "fb3da020",
        "outputId": "dfd43ff9-e51d-4dc1-bf7c-f21dde61d7c1"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Collecting openmim\n",
            "  Downloading openmim-0.1.5.tar.gz (35 kB)\n",
            "Requirement already satisfied: Click==7.1.2 in /usr/local/lib/python3.7/dist-packages (from openmim) (7.1.2)\n",
            "Collecting colorama\n",
            "  Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from openmim) (2.23.0)\n",
            "Collecting model-index\n",
            "  Downloading model_index-0.1.11-py3-none-any.whl (34 kB)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from openmim) (1.3.5)\n",
            "Requirement already satisfied: tabulate in /usr/local/lib/python3.7/dist-packages (from openmim) (0.8.9)\n",
            "Requirement already satisfied: markdown in /usr/local/lib/python3.7/dist-packages (from model-index->openmim) (3.3.6)\n",
            "Collecting ordered-set\n",
            "  Downloading ordered_set-4.1.0-py3-none-any.whl (7.6 kB)\n",
            "Requirement already satisfied: pyyaml in /usr/local/lib/python3.7/dist-packages (from model-index->openmim) (3.13)\n",
            "Requirement already satisfied: importlib-metadata>=4.4 in /usr/local/lib/python3.7/dist-packages (from markdown->model-index->openmim) (4.11.3)\n",
            "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->markdown->model-index->openmim) (3.7.0)\n",
            "Requirement already satisfied: typing-extensions>=3.6.4 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->markdown->model-index->openmim) (3.10.0.2)\n",
            "Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.7/dist-packages (from pandas->openmim) (1.21.5)\n",
            "Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas->openmim) (2.8.2)\n",
            "Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->openmim) (2018.9)\n",
            "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas->openmim) (1.15.0)\n",
            "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->openmim) (2.10)\n",
            "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->openmim) (1.24.3)\n",
            "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->openmim) (3.0.4)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->openmim) (2021.10.8)\n",
            "Building wheels for collected packages: openmim\n",
            "  Building wheel for openmim (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for openmim: filename=openmim-0.1.5-py2.py3-none-any.whl size=42503 sha256=6957857625db07e7d2c995d0fa19d98dd58f3daea577a3bc933b16edab669fb4\n",
            "  Stored in directory: /root/.cache/pip/wheels/16/8b/e1/bdebbbc687aa50224a5ce46fe97a040a0c59f92b34bfc750b6\n",
            "Successfully built openmim\n",
            "Installing collected packages: ordered-set, model-index, colorama, openmim\n",
            "Successfully installed colorama-0.4.4 model-index-0.1.11 openmim-0.1.5 ordered-set-4.1.0\n"
          ]
        }
      ],
      "source": [
        "!pip install openmim"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "id": "e3e73f09",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "e3e73f09",
        "outputId": "4db8c20e-9ce3-4a1c-8755-6c8e17988268"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "installing mmcv-full from wheel.\n",
            "Looking in links: https://download.openmmlab.com/mmcv/dist/cu111/torch1.10.0/index.html\n",
            "Collecting mmcv-full==1.4.7\n",
            "  Downloading https://download.openmmlab.com/mmcv/dist/cu111/torch1.10.0/mmcv_full-1.4.7-cp37-cp37m-manylinux1_x86_64.whl (46.3 MB)\n",
            "\u001b[K     |████████████████████████████████| 46.3 MB 158 kB/s \n",
            "\u001b[?25hRequirement already satisfied: pyyaml in /usr/local/lib/python3.7/dist-packages (from mmcv-full==1.4.7) (3.13)\n",
            "Requirement already satisfied: Pillow in /usr/local/lib/python3.7/dist-packages (from mmcv-full==1.4.7) (7.1.2)\n",
            "Collecting yapf\n",
            "  Downloading yapf-0.32.0-py2.py3-none-any.whl (190 kB)\n",
            "\u001b[K     |████████████████████████████████| 190 kB 3.9 MB/s \n",
            "\u001b[?25hRequirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from mmcv-full==1.4.7) (21.3)\n",
            "Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from mmcv-full==1.4.7) (1.21.5)\n",
            "Collecting addict\n",
            "  Downloading addict-2.4.0-py3-none-any.whl (3.8 kB)\n",
            "Requirement already satisfied: opencv-python>=3 in /usr/local/lib/python3.7/dist-packages (from mmcv-full==1.4.7) (4.1.2.30)\n",
            "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging->mmcv-full==1.4.7) (3.0.7)\n",
            "Installing collected packages: yapf, addict, mmcv-full\n",
            "Successfully installed addict-2.4.0 mmcv-full-1.4.7 yapf-0.32.0\n",
            "\u001b[32mSuccessfully installed mmcv-full.\u001b[0m\n"
          ]
        }
      ],
      "source": [
        "!mim install mmcv-full"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "86e6d589",
      "metadata": {
        "id": "86e6d589"
      },
      "source": [
        "Besides, you can also use pip to install the packages, but you are supposed to check the pytorch and cuda version manually. The example command is provided below, but you need to modify it according to your PyTorch and CUDA version."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "5b004a18",
      "metadata": {
        "id": "5b004a18"
      },
      "outputs": [],
      "source": [
        "# Install mmcv and mmcls\n",
        "!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.10/index.html"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "54815b81",
      "metadata": {
        "id": "54815b81"
      },
      "source": [
        "## Clone and install mmselfsup"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "id": "207561bb",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "207561bb",
        "outputId": "cc3ecfd5-f812-4910-ba46-f46fb99aa42c"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Cloning into 'mmselfsup'...\n",
            "remote: Enumerating objects: 3255, done.\u001b[K\n",
            "remote: Counting objects: 100% (872/872), done.\u001b[K\n",
            "remote: Compressing objects: 100% (524/524), done.\u001b[K\n",
            "remote: Total 3255 (delta 534), reused 446 (delta 347), pack-reused 2383\u001b[K\n",
            "Receiving objects: 100% (3255/3255), 1.96 MiB | 6.78 MiB/s, done.\n",
            "Resolving deltas: 100% (1911/1911), done.\n",
            "/content/mmselfsup\n",
            "Obtaining file:///content/mmselfsup\n",
            "Requirement already satisfied: future in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (0.16.0)\n",
            "Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (3.2.2)\n",
            "Collecting mmcls<=0.20.1,>=0.19.0\n",
            "  Downloading mmcls-0.20.1-py2.py3-none-any.whl (490 kB)\n",
            "\u001b[K     |████████████████████████████████| 490 kB 4.3 MB/s \n",
            "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (1.21.5)\n",
            "Requirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (21.3)\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (1.4.1)\n",
            "Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (1.15.0)\n",
            "Requirement already satisfied: sklearn in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (0.0)\n",
            "Requirement already satisfied: tensorboard in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (2.8.0)\n",
            "Collecting timm\n",
            "  Downloading timm-0.5.4-py3-none-any.whl (431 kB)\n",
            "\u001b[K     |████████████████████████████████| 431 kB 48.8 MB/s \n",
            "\u001b[?25hRequirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from mmselfsup==0.7.1) (4.63.0)\n",
            "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->mmselfsup==0.7.1) (3.0.7)\n",
            "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->mmselfsup==0.7.1) (1.4.0)\n",
            "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->mmselfsup==0.7.1) (0.11.0)\n",
            "Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->mmselfsup==0.7.1) (2.8.2)\n",
            "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1->matplotlib->mmselfsup==0.7.1) (3.10.0.2)\n",
            "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.7/dist-packages (from sklearn->mmselfsup==0.7.1) (1.0.2)\n",
            "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->sklearn->mmselfsup==0.7.1) (3.1.0)\n",
            "Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->sklearn->mmselfsup==0.7.1) (1.1.0)\n",
            "Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (0.6.1)\n",
            "Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (1.0.1)\n",
            "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (0.37.1)\n",
            "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (57.4.0)\n",
            "Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (2.23.0)\n",
            "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (1.0.0)\n",
            "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (1.35.0)\n",
            "Requirement already satisfied: grpcio>=1.24.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (1.44.0)\n",
            "Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (0.4.6)\n",
            "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (3.3.6)\n",
            "Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (1.8.1)\n",
            "Requirement already satisfied: protobuf>=3.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard->mmselfsup==0.7.1) (3.17.3)\n",
            "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard->mmselfsup==0.7.1) (4.8)\n",
            "Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard->mmselfsup==0.7.1) (4.2.4)\n",
            "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard->mmselfsup==0.7.1) (0.2.8)\n",
            "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard->mmselfsup==0.7.1) (1.3.1)\n",
            "Requirement already satisfied: importlib-metadata>=4.4 in /usr/local/lib/python3.7/dist-packages (from markdown>=2.6.8->tensorboard->mmselfsup==0.7.1) (4.11.3)\n",
            "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard->mmselfsup==0.7.1) (3.7.0)\n",
            "Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard->mmselfsup==0.7.1) (0.4.8)\n",
            "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard->mmselfsup==0.7.1) (1.24.3)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard->mmselfsup==0.7.1) (2021.10.8)\n",
            "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard->mmselfsup==0.7.1) (2.10)\n",
            "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard->mmselfsup==0.7.1) (3.0.4)\n",
            "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard->mmselfsup==0.7.1) (3.2.0)\n",
            "Requirement already satisfied: torch>=1.4 in /usr/local/lib/python3.7/dist-packages (from timm->mmselfsup==0.7.1) (1.10.0+cu111)\n",
            "Requirement already satisfied: torchvision in /usr/local/lib/python3.7/dist-packages (from timm->mmselfsup==0.7.1) (0.11.1+cu111)\n",
            "Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in /usr/local/lib/python3.7/dist-packages (from torchvision->timm->mmselfsup==0.7.1) (7.1.2)\n",
            "Installing collected packages: timm, mmcls, mmselfsup\n",
            "  Running setup.py develop for mmselfsup\n",
            "Successfully installed mmcls-0.20.1 mmselfsup-0.7.1 timm-0.5.4\n"
          ]
        }
      ],
      "source": [
        "# Clone MMSelfSup repository\n",
        "!git clone https://github.com/open-mmlab/mmselfsup.git\n",
        "%cd mmselfsup/\n",
        "\n",
        "# Install MMSelfSup from source\n",
        "!pip install -e . "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "id": "53cda7d3",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "53cda7d3",
        "outputId": "9e039eb8-24af-4b11-87c5-fd15d3195eee"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "0.7.1\n"
          ]
        }
      ],
      "source": [
        "# Check MMSelfSup installation\n",
        "import mmselfsup\n",
        "print(mmselfsup.__version__)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "d36ec528",
      "metadata": {
        "id": "d36ec528"
      },
      "source": [
        "## Example to start a self-supervised task\n",
        "\n",
        "Before you start training, you need to prepare your dataset, please check [prepare_data.md](https://github.com/open-mmlab/mmselfsup/blob/master/docs/en/prepare_data.md) file carefully.\n",
        "\n",
        "**Note**: As we follow the original algorithms to implement our codes, so many algorithms are supposed to run on distributed mode, they are not supported on 1 GPU training officially. You can check it [here](https://github.com/open-mmlab/mmselfsup/blob/master/tools/train.py#L120).\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "id": "4fCR3h5nn26l",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "4fCR3h5nn26l",
        "outputId": "7dc71982-7177-4a11-fda7-ae0e99e4bc89"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "/content/mmselfsup\n"
          ]
        }
      ],
      "source": [
        "!pwd"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "i-7LXl36VV--",
      "metadata": {
        "id": "i-7LXl36VV--"
      },
      "source": [
        "Here we provide a example and download a small dataset to display the demo."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "id": "VDM0ZHHKUZNP",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "VDM0ZHHKUZNP",
        "outputId": "c9f13fac-4e23-4bc8-fff1-3244bc1f2956"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "--2022-03-25 05:21:14--  https://download.openmmlab.com/mmselfsup/data/imagenet_examples.zip\n",
            "Resolving download.openmmlab.com (download.openmmlab.com)... 47.75.20.18\n",
            "Connecting to download.openmmlab.com (download.openmmlab.com)|47.75.20.18|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 155496559 (148M) [application/zip]\n",
            "Saving to: ‘imagenet_examples.zip’\n",
            "\n",
            "imagenet_examples.z 100%[===================>] 148.29M  14.2MB/s    in 12s     \n",
            "\n",
            "2022-03-25 05:21:26 (12.5 MB/s) - ‘imagenet_examples.zip’ saved [155496559/155496559]\n",
            "\n"
          ]
        }
      ],
      "source": [
        "!mkdir data\n",
        "!wget https://download.openmmlab.com/mmselfsup/data/imagenet_examples.zip\n",
        "!unzip -q imagenet_examples.zip -d ./data/"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "id": "tOGY00U4WPGC",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "tOGY00U4WPGC",
        "outputId": "5a54a9aa-5c4f-4ebf-d636-4b4e8af68908"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Reading package lists... Done\n",
            "Building dependency tree       \n",
            "Reading state information... Done\n",
            "The following NEW packages will be installed:\n",
            "  tree\n",
            "0 upgraded, 1 newly installed, 0 to remove and 39 not upgraded.\n",
            "Need to get 40.7 kB of archives.\n",
            "After this operation, 105 kB of additional disk space will be used.\n",
            "Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 tree amd64 1.7.0-5 [40.7 kB]\n",
            "Fetched 40.7 kB in 1s (45.2 kB/s)\n",
            "Selecting previously unselected package tree.\n",
            "(Reading database ... 156210 files and directories currently installed.)\n",
            "Preparing to unpack .../tree_1.7.0-5_amd64.deb ...\n",
            "Unpacking tree (1.7.0-5) ...\n",
            "Setting up tree (1.7.0-5) ...\n",
            "Processing triggers for man-db (2.8.3-2ubuntu0.1) ...\n",
            "./data\n",
            "└── imagenet\n",
            "    ├── meta\n",
            "    └── train\n",
            "        └── n01440764\n",
            "\n",
            "4 directories\n"
          ]
        }
      ],
      "source": [
        "# Check data directory\n",
        "!apt-get install tree\n",
        "!tree -d ./data"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "SF5vqi1nmqGh",
      "metadata": {
        "id": "SF5vqi1nmqGh"
      },
      "source": [
        "### Create a new config file\n",
        "To reuse the common parts of different config files, we support inheriting multiple base config files. For example, to train `relative_loc` algorithm, the new config file can create the model's basic structure by inheriting `configs/_base_/models/relative-loc.py`."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "id": "h2y2bh9DnE8b",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "h2y2bh9DnE8b",
        "outputId": "b2a0a019-c5aa-420e-ad6c-4a8c6c3c3c58"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Writing configs/selfsup/relative_loc/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab.py\n"
          ]
        }
      ],
      "source": [
        "%%writefile configs/selfsup/relative_loc/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab.py\n",
        "_base_ = [\n",
        "    '../_base_/models/relative-loc.py',\n",
        "    '../_base_/datasets/imagenet_relative-loc.py',\n",
        "    '../_base_/schedules/sgd_steplr-200e_in1k.py',\n",
        "    '../_base_/default_runtime.py',\n",
        "]\n",
        "\n",
        "log_config = dict(interval=10)\n",
        "\n",
        "# optimizer\n",
        "optimizer = dict(\n",
        "    type='SGD',\n",
        "    lr=0.2,\n",
        "    weight_decay=1e-4,\n",
        "    momentum=0.9,\n",
        "    paramwise_options={\n",
        "        '\\\\Aneck.': dict(weight_decay=5e-4),\n",
        "        '\\\\Ahead.': dict(weight_decay=5e-4)\n",
        "    })\n",
        "\n",
        "# learning policy\n",
        "lr_config = dict(policy='step', step=[1])\n",
        "\n",
        "# runtime settings\n",
        "runner = dict(type='EpochBasedRunner', max_epochs=70)\n",
        "# the max_keep_ckpts controls the max number of ckpt file in your work_dirs\n",
        "# if it is 3, when CheckpointHook (in mmcv) saves the 4th ckpt\n",
        "# it will remove the oldest one to keep the number of total ckpts as 3\n",
        "checkpoint_config = dict(interval=1, max_keep_ckpts=3)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "ahdJBk_2xXbQ",
      "metadata": {
        "id": "ahdJBk_2xXbQ"
      },
      "source": [
        "### Read the config file and modify config\n",
        "\n",
        "We can modify the loaded config file."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "id": "9zlGPEAAx4Z5",
      "metadata": {
        "id": "9zlGPEAAx4Z5"
      },
      "outputs": [],
      "source": [
        "# Load the basic config file\n",
        "from mmcv import Config\n",
        "cfg = Config.fromfile('configs/selfsup/relative_loc/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab.py')\n",
        "\n",
        "# Specify the data settings\n",
        "cfg.data.samples_per_gpu = 64\n",
        "cfg.data.workers_per_gpu = 2\n",
        "\n",
        "# Modify the path and meta files of validation dataset\n",
        "cfg.data.val.data_source.data_prefix = 'data/imagenet/train'\n",
        "cfg.data.val.data_source.ann_file = 'data/imagenet/meta/train.txt'\n",
        "\n",
        "# Specify the optimizer\n",
        "cfg.optimizer = dict(type='SGD', lr=0.005, momentum=0.9, weight_decay=0.0001)\n",
        "cfg.optimizer_config = dict(grad_clip=None)\n",
        "\n",
        "# Specify the learning rate scheduler\n",
        "cfg.lr_config = dict(policy='step', step=[1])\n",
        "\n",
        "# Modify runtime setting\n",
        "cfg.runner = dict(type='EpochBasedRunner', max_epochs=2)\n",
        "\n",
        "# Specify the work directory\n",
        "cfg.work_dir = './work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab'\n",
        "\n",
        "# Output logs for every 10 iterations\n",
        "cfg.log_config.interval = 10\n",
        "\n",
        "# Set the random seed and enable the deterministic option of cuDNN\n",
        "# to keep the results' reproducible.\n",
        "from mmselfsup.apis import set_random_seed\n",
        "cfg.seed = 0\n",
        "set_random_seed(0, deterministic=True)\n",
        "\n",
        "cfg.gpu_ids = range(1)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "e2j-EtlHukMu",
      "metadata": {
        "id": "e2j-EtlHukMu"
      },
      "source": [
        "### Start self-supervised pre-train task"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "id": "ufvDKC5Wvmni",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ufvDKC5Wvmni",
        "outputId": "2dafe4cf-01f7-4864-f6c7-bb37c0e6ef3d"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py:255: DeprecationWarning: The old API of register_module(module, force=False) is deprecated and will be removed, please use the new API register_module(name=None, force=False, module=None) instead.\n",
            "  DeprecationWarning)\n",
            "/usr/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject\n",
            "  return f(*args, **kwds)\n",
            "/usr/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject\n",
            "  return f(*args, **kwds)\n",
            "/usr/local/lib/python3.7/dist-packages/scipy/special/orthogonal.py:81: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.\n",
            "Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n",
            "  from numpy import (exp, inf, pi, sqrt, floor, sin, cos, around, int,\n",
            "2022-03-25 05:22:25,799 - mmcv - INFO - initialize ResNet with init_cfg [{'type': 'Kaiming', 'layer': 'Conv2d'}, {'type': 'Constant', 'val': 1, 'layer': ['_BatchNorm', 'GroupNorm']}]\n",
            "2022-03-25 05:22:26,090 - mmcv - INFO - initialize RelativeLocNeck with init_cfg [{'type': 'Normal', 'std': 0.01, 'layer': 'Linear'}, {'type': 'Constant', 'val': 1, 'layer': ['_BatchNorm', 'GroupNorm']}]\n",
            "2022-03-25 05:22:26,255 - mmcv - INFO - initialize ClsHead with init_cfg [{'type': 'Normal', 'std': 0.005, 'layer': 'Linear'}, {'type': 'Constant', 'val': 1, 'layer': ['_BatchNorm', 'GroupNorm']}]\n",
            "2022-03-25 05:22:26,258 - mmcv - INFO - \n",
            "backbone.conv1.weight - torch.Size([64, 3, 7, 7]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,262 - mmcv - INFO - \n",
            "backbone.bn1.weight - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,266 - mmcv - INFO - \n",
            "backbone.bn1.bias - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,269 - mmcv - INFO - \n",
            "backbone.layer1.0.conv1.weight - torch.Size([64, 64, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,276 - mmcv - INFO - \n",
            "backbone.layer1.0.bn1.weight - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,278 - mmcv - INFO - \n",
            "backbone.layer1.0.bn1.bias - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,280 - mmcv - INFO - \n",
            "backbone.layer1.0.conv2.weight - torch.Size([64, 64, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,282 - mmcv - INFO - \n",
            "backbone.layer1.0.bn2.weight - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,284 - mmcv - INFO - \n",
            "backbone.layer1.0.bn2.bias - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,286 - mmcv - INFO - \n",
            "backbone.layer1.0.conv3.weight - torch.Size([256, 64, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,288 - mmcv - INFO - \n",
            "backbone.layer1.0.bn3.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,290 - mmcv - INFO - \n",
            "backbone.layer1.0.bn3.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,292 - mmcv - INFO - \n",
            "backbone.layer1.0.downsample.0.weight - torch.Size([256, 64, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,294 - mmcv - INFO - \n",
            "backbone.layer1.0.downsample.1.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,296 - mmcv - INFO - \n",
            "backbone.layer1.0.downsample.1.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,298 - mmcv - INFO - \n",
            "backbone.layer1.1.conv1.weight - torch.Size([64, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,300 - mmcv - INFO - \n",
            "backbone.layer1.1.bn1.weight - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,301 - mmcv - INFO - \n",
            "backbone.layer1.1.bn1.bias - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,304 - mmcv - INFO - \n",
            "backbone.layer1.1.conv2.weight - torch.Size([64, 64, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,305 - mmcv - INFO - \n",
            "backbone.layer1.1.bn2.weight - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,312 - mmcv - INFO - \n",
            "backbone.layer1.1.bn2.bias - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,316 - mmcv - INFO - \n",
            "backbone.layer1.1.conv3.weight - torch.Size([256, 64, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,319 - mmcv - INFO - \n",
            "backbone.layer1.1.bn3.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,322 - mmcv - INFO - \n",
            "backbone.layer1.1.bn3.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,325 - mmcv - INFO - \n",
            "backbone.layer1.2.conv1.weight - torch.Size([64, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,327 - mmcv - INFO - \n",
            "backbone.layer1.2.bn1.weight - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,329 - mmcv - INFO - \n",
            "backbone.layer1.2.bn1.bias - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,330 - mmcv - INFO - \n",
            "backbone.layer1.2.conv2.weight - torch.Size([64, 64, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,332 - mmcv - INFO - \n",
            "backbone.layer1.2.bn2.weight - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,334 - mmcv - INFO - \n",
            "backbone.layer1.2.bn2.bias - torch.Size([64]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,336 - mmcv - INFO - \n",
            "backbone.layer1.2.conv3.weight - torch.Size([256, 64, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,337 - mmcv - INFO - \n",
            "backbone.layer1.2.bn3.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,342 - mmcv - INFO - \n",
            "backbone.layer1.2.bn3.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,346 - mmcv - INFO - \n",
            "backbone.layer2.0.conv1.weight - torch.Size([128, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,347 - mmcv - INFO - \n",
            "backbone.layer2.0.bn1.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,349 - mmcv - INFO - \n",
            "backbone.layer2.0.bn1.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,350 - mmcv - INFO - \n",
            "backbone.layer2.0.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,352 - mmcv - INFO - \n",
            "backbone.layer2.0.bn2.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,356 - mmcv - INFO - \n",
            "backbone.layer2.0.bn2.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,357 - mmcv - INFO - \n",
            "backbone.layer2.0.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,361 - mmcv - INFO - \n",
            "backbone.layer2.0.bn3.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,364 - mmcv - INFO - \n",
            "backbone.layer2.0.bn3.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,366 - mmcv - INFO - \n",
            "backbone.layer2.0.downsample.0.weight - torch.Size([512, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,367 - mmcv - INFO - \n",
            "backbone.layer2.0.downsample.1.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,370 - mmcv - INFO - \n",
            "backbone.layer2.0.downsample.1.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,374 - mmcv - INFO - \n",
            "backbone.layer2.1.conv1.weight - torch.Size([128, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,378 - mmcv - INFO - \n",
            "backbone.layer2.1.bn1.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,380 - mmcv - INFO - \n",
            "backbone.layer2.1.bn1.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,384 - mmcv - INFO - \n",
            "backbone.layer2.1.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,386 - mmcv - INFO - \n",
            "backbone.layer2.1.bn2.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,387 - mmcv - INFO - \n",
            "backbone.layer2.1.bn2.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,393 - mmcv - INFO - \n",
            "backbone.layer2.1.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,395 - mmcv - INFO - \n",
            "backbone.layer2.1.bn3.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,397 - mmcv - INFO - \n",
            "backbone.layer2.1.bn3.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,399 - mmcv - INFO - \n",
            "backbone.layer2.2.conv1.weight - torch.Size([128, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,401 - mmcv - INFO - \n",
            "backbone.layer2.2.bn1.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,403 - mmcv - INFO - \n",
            "backbone.layer2.2.bn1.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,404 - mmcv - INFO - \n",
            "backbone.layer2.2.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,406 - mmcv - INFO - \n",
            "backbone.layer2.2.bn2.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,407 - mmcv - INFO - \n",
            "backbone.layer2.2.bn2.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,409 - mmcv - INFO - \n",
            "backbone.layer2.2.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,414 - mmcv - INFO - \n",
            "backbone.layer2.2.bn3.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,415 - mmcv - INFO - \n",
            "backbone.layer2.2.bn3.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,418 - mmcv - INFO - \n",
            "backbone.layer2.3.conv1.weight - torch.Size([128, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,419 - mmcv - INFO - \n",
            "backbone.layer2.3.bn1.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,421 - mmcv - INFO - \n",
            "backbone.layer2.3.bn1.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,422 - mmcv - INFO - \n",
            "backbone.layer2.3.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,424 - mmcv - INFO - \n",
            "backbone.layer2.3.bn2.weight - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,426 - mmcv - INFO - \n",
            "backbone.layer2.3.bn2.bias - torch.Size([128]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,428 - mmcv - INFO - \n",
            "backbone.layer2.3.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,430 - mmcv - INFO - \n",
            "backbone.layer2.3.bn3.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,432 - mmcv - INFO - \n",
            "backbone.layer2.3.bn3.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,433 - mmcv - INFO - \n",
            "backbone.layer3.0.conv1.weight - torch.Size([256, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,435 - mmcv - INFO - \n",
            "backbone.layer3.0.bn1.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,437 - mmcv - INFO - \n",
            "backbone.layer3.0.bn1.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,439 - mmcv - INFO - \n",
            "backbone.layer3.0.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,441 - mmcv - INFO - \n",
            "backbone.layer3.0.bn2.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,442 - mmcv - INFO - \n",
            "backbone.layer3.0.bn2.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,444 - mmcv - INFO - \n",
            "backbone.layer3.0.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,446 - mmcv - INFO - \n",
            "backbone.layer3.0.bn3.weight - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,448 - mmcv - INFO - \n",
            "backbone.layer3.0.bn3.bias - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,450 - mmcv - INFO - \n",
            "backbone.layer3.0.downsample.0.weight - torch.Size([1024, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,451 - mmcv - INFO - \n",
            "backbone.layer3.0.downsample.1.weight - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,453 - mmcv - INFO - \n",
            "backbone.layer3.0.downsample.1.bias - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,455 - mmcv - INFO - \n",
            "backbone.layer3.1.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,457 - mmcv - INFO - \n",
            "backbone.layer3.1.bn1.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,458 - mmcv - INFO - \n",
            "backbone.layer3.1.bn1.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,460 - mmcv - INFO - \n",
            "backbone.layer3.1.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,462 - mmcv - INFO - \n",
            "backbone.layer3.1.bn2.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,463 - mmcv - INFO - \n",
            "backbone.layer3.1.bn2.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,465 - mmcv - INFO - \n",
            "backbone.layer3.1.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,467 - mmcv - INFO - \n",
            "backbone.layer3.1.bn3.weight - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,469 - mmcv - INFO - \n",
            "backbone.layer3.1.bn3.bias - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,471 - mmcv - INFO - \n",
            "backbone.layer3.2.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,473 - mmcv - INFO - \n",
            "backbone.layer3.2.bn1.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,475 - mmcv - INFO - \n",
            "backbone.layer3.2.bn1.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,477 - mmcv - INFO - \n",
            "backbone.layer3.2.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,478 - mmcv - INFO - \n",
            "backbone.layer3.2.bn2.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,480 - mmcv - INFO - \n",
            "backbone.layer3.2.bn2.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,482 - mmcv - INFO - \n",
            "backbone.layer3.2.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,483 - mmcv - INFO - \n",
            "backbone.layer3.2.bn3.weight - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,485 - mmcv - INFO - \n",
            "backbone.layer3.2.bn3.bias - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,487 - mmcv - INFO - \n",
            "backbone.layer3.3.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,489 - mmcv - INFO - \n",
            "backbone.layer3.3.bn1.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,491 - mmcv - INFO - \n",
            "backbone.layer3.3.bn1.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,493 - mmcv - INFO - \n",
            "backbone.layer3.3.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,494 - mmcv - INFO - \n",
            "backbone.layer3.3.bn2.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,496 - mmcv - INFO - \n",
            "backbone.layer3.3.bn2.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,498 - mmcv - INFO - \n",
            "backbone.layer3.3.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,500 - mmcv - INFO - \n",
            "backbone.layer3.3.bn3.weight - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,501 - mmcv - INFO - \n",
            "backbone.layer3.3.bn3.bias - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,503 - mmcv - INFO - \n",
            "backbone.layer3.4.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,505 - mmcv - INFO - \n",
            "backbone.layer3.4.bn1.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,507 - mmcv - INFO - \n",
            "backbone.layer3.4.bn1.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,509 - mmcv - INFO - \n",
            "backbone.layer3.4.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,511 - mmcv - INFO - \n",
            "backbone.layer3.4.bn2.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,512 - mmcv - INFO - \n",
            "backbone.layer3.4.bn2.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,514 - mmcv - INFO - \n",
            "backbone.layer3.4.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,516 - mmcv - INFO - \n",
            "backbone.layer3.4.bn3.weight - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,518 - mmcv - INFO - \n",
            "backbone.layer3.4.bn3.bias - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,520 - mmcv - INFO - \n",
            "backbone.layer3.5.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,530 - mmcv - INFO - \n",
            "backbone.layer3.5.bn1.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,531 - mmcv - INFO - \n",
            "backbone.layer3.5.bn1.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,533 - mmcv - INFO - \n",
            "backbone.layer3.5.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,535 - mmcv - INFO - \n",
            "backbone.layer3.5.bn2.weight - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,537 - mmcv - INFO - \n",
            "backbone.layer3.5.bn2.bias - torch.Size([256]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,538 - mmcv - INFO - \n",
            "backbone.layer3.5.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,540 - mmcv - INFO - \n",
            "backbone.layer3.5.bn3.weight - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,542 - mmcv - INFO - \n",
            "backbone.layer3.5.bn3.bias - torch.Size([1024]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,543 - mmcv - INFO - \n",
            "backbone.layer4.0.conv1.weight - torch.Size([512, 1024, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,545 - mmcv - INFO - \n",
            "backbone.layer4.0.bn1.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,547 - mmcv - INFO - \n",
            "backbone.layer4.0.bn1.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,548 - mmcv - INFO - \n",
            "backbone.layer4.0.conv2.weight - torch.Size([512, 512, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,550 - mmcv - INFO - \n",
            "backbone.layer4.0.bn2.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,551 - mmcv - INFO - \n",
            "backbone.layer4.0.bn2.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,553 - mmcv - INFO - \n",
            "backbone.layer4.0.conv3.weight - torch.Size([2048, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,554 - mmcv - INFO - \n",
            "backbone.layer4.0.bn3.weight - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,556 - mmcv - INFO - \n",
            "backbone.layer4.0.bn3.bias - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,558 - mmcv - INFO - \n",
            "backbone.layer4.0.downsample.0.weight - torch.Size([2048, 1024, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,559 - mmcv - INFO - \n",
            "backbone.layer4.0.downsample.1.weight - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,561 - mmcv - INFO - \n",
            "backbone.layer4.0.downsample.1.bias - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,563 - mmcv - INFO - \n",
            "backbone.layer4.1.conv1.weight - torch.Size([512, 2048, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,565 - mmcv - INFO - \n",
            "backbone.layer4.1.bn1.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,580 - mmcv - INFO - \n",
            "backbone.layer4.1.bn1.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,584 - mmcv - INFO - \n",
            "backbone.layer4.1.conv2.weight - torch.Size([512, 512, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,586 - mmcv - INFO - \n",
            "backbone.layer4.1.bn2.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,588 - mmcv - INFO - \n",
            "backbone.layer4.1.bn2.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,589 - mmcv - INFO - \n",
            "backbone.layer4.1.conv3.weight - torch.Size([2048, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,591 - mmcv - INFO - \n",
            "backbone.layer4.1.bn3.weight - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,595 - mmcv - INFO - \n",
            "backbone.layer4.1.bn3.bias - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,596 - mmcv - INFO - \n",
            "backbone.layer4.2.conv1.weight - torch.Size([512, 2048, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,600 - mmcv - INFO - \n",
            "backbone.layer4.2.bn1.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,601 - mmcv - INFO - \n",
            "backbone.layer4.2.bn1.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,604 - mmcv - INFO - \n",
            "backbone.layer4.2.conv2.weight - torch.Size([512, 512, 3, 3]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,607 - mmcv - INFO - \n",
            "backbone.layer4.2.bn2.weight - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,609 - mmcv - INFO - \n",
            "backbone.layer4.2.bn2.bias - torch.Size([512]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,612 - mmcv - INFO - \n",
            "backbone.layer4.2.conv3.weight - torch.Size([2048, 512, 1, 1]): \n",
            "KaimingInit: a=0, mode=fan_out, nonlinearity=relu, distribution =normal, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,614 - mmcv - INFO - \n",
            "backbone.layer4.2.bn3.weight - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,616 - mmcv - INFO - \n",
            "backbone.layer4.2.bn3.bias - torch.Size([2048]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,619 - mmcv - INFO - \n",
            "neck.fc.weight - torch.Size([4096, 4096]): \n",
            "NormalInit: mean=0, std=0.01, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,621 - mmcv - INFO - \n",
            "neck.fc.bias - torch.Size([4096]): \n",
            "NormalInit: mean=0, std=0.01, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,623 - mmcv - INFO - \n",
            "neck.bn.weight - torch.Size([4096]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,625 - mmcv - INFO - \n",
            "neck.bn.bias - torch.Size([4096]): \n",
            "The value is the same before and after calling `init_weights` of RelativeLoc  \n",
            " \n",
            "2022-03-25 05:22:26,628 - mmcv - INFO - \n",
            "head.fc_cls.weight - torch.Size([8, 4096]): \n",
            "NormalInit: mean=0, std=0.005, bias=0 \n",
            " \n",
            "2022-03-25 05:22:26,630 - mmcv - INFO - \n",
            "head.fc_cls.bias - torch.Size([8]): \n",
            "NormalInit: mean=0, std=0.005, bias=0 \n",
            " \n",
            "/content/mmselfsup/mmselfsup/datasets/base.py:29: UserWarning: The dataset part will be refactored, it will soon support `dict` in pipelines to save more information, the same as the pipeline in `MMDet`.\n",
            "  warnings.warn('The dataset part will be refactored, it will soon '\n",
            "2022-03-25 05:22:36,359 - mmselfsup - INFO - Start running, host: root@f8465e2b77d5, work_dir: /content/mmselfsup/work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab\n",
            "2022-03-25 05:22:36,362 - mmselfsup - INFO - Hooks will be executed in the following order:\n",
            "before_run:\n",
            "(VERY_HIGH   ) StepLrUpdaterHook                  \n",
            "(NORMAL      ) CheckpointHook                     \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_train_epoch:\n",
            "(VERY_HIGH   ) StepLrUpdaterHook                  \n",
            "(LOW         ) IterTimerHook                      \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_train_iter:\n",
            "(VERY_HIGH   ) StepLrUpdaterHook                  \n",
            "(LOW         ) IterTimerHook                      \n",
            " -------------------- \n",
            "after_train_iter:\n",
            "(ABOVE_NORMAL) OptimizerHook                      \n",
            "(NORMAL      ) CheckpointHook                     \n",
            "(LOW         ) IterTimerHook                      \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "after_train_epoch:\n",
            "(NORMAL      ) CheckpointHook                     \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_val_epoch:\n",
            "(LOW         ) IterTimerHook                      \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_val_iter:\n",
            "(LOW         ) IterTimerHook                      \n",
            " -------------------- \n",
            "after_val_iter:\n",
            "(LOW         ) IterTimerHook                      \n",
            " -------------------- \n",
            "after_val_epoch:\n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "after_run:\n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "2022-03-25 05:22:36,366 - mmselfsup - INFO - workflow: [('train', 1)], max: 2 epochs\n",
            "2022-03-25 05:22:36,369 - mmselfsup - INFO - Checkpoints will be saved to /content/mmselfsup/work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab by HardDiskBackend.\n",
            "2022-03-25 05:23:04,342 - mmselfsup - INFO - Epoch [1][10/21]\tlr: 5.000e-03, eta: 0:01:27, time: 2.738, data_time: 0.402, memory: 7428, loss: 2.1114, acc: 12.4805\n",
            "2022-03-25 05:23:28,178 - mmselfsup - INFO - Epoch [1][20/21]\tlr: 5.000e-03, eta: 0:00:56, time: 2.383, data_time: 0.060, memory: 7428, loss: 2.1013, acc: 14.0430\n",
            "2022-03-25 05:23:28,809 - mmselfsup - INFO - Saving checkpoint at 1 epochs\n",
            "2022-03-25 05:23:58,608 - mmselfsup - INFO - Epoch [2][10/21]\tlr: 5.000e-04, eta: 0:00:27, time: 2.730, data_time: 0.380, memory: 7428, loss: 2.0941, acc: 14.8633\n",
            "2022-03-25 05:24:22,557 - mmselfsup - INFO - Epoch [2][20/21]\tlr: 5.000e-04, eta: 0:00:02, time: 2.395, data_time: 0.061, memory: 7428, loss: 2.0829, acc: 14.0039\n",
            "2022-03-25 05:24:23,182 - mmselfsup - INFO - Saving checkpoint at 2 epochs\n"
          ]
        }
      ],
      "source": [
        "import time\n",
        "import mmcv\n",
        "import os.path as osp\n",
        "\n",
        "from mmselfsup.datasets import build_dataset\n",
        "from mmselfsup.models import build_algorithm\n",
        "from mmselfsup.apis import train_model\n",
        "\n",
        "# Create the work directory\n",
        "mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir))\n",
        "\n",
        "# Build the algorithm\n",
        "model = build_algorithm(cfg.model)\n",
        "model.init_weights()\n",
        "\n",
        "# Build the dataset\n",
        "datasets = [build_dataset(cfg.data.train)]\n",
        "\n",
        "# Start pre-train\n",
        "train_model(\n",
        "    model,\n",
        "    datasets,\n",
        "    cfg,\n",
        "    distributed=False,\n",
        "    timestamp=time.strftime('%Y%m%d_%H%M%S', time.localtime()),\n",
        "    meta=dict())"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "4a78a656",
      "metadata": {
        "id": "4a78a656"
      },
      "source": [
        "## Example to start a downstream task\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "id": "GH7JAKYifrsJ",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "GH7JAKYifrsJ",
        "outputId": "972c3ce0-9c68-4213-8bb3-ab877b9cccc6"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "/content/mmselfsup\n"
          ]
        }
      ],
      "source": [
        "!pwd"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "Qy4OauSGomPv",
      "metadata": {
        "id": "Qy4OauSGomPv"
      },
      "source": [
        "### Extract backbone weights from pre-train model"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "id": "QfFjDyl-ow5M",
      "metadata": {
        "id": "QfFjDyl-ow5M"
      },
      "outputs": [],
      "source": [
        "!python tools/model_converters/extract_backbone_weights.py \\\n",
        "  work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/epoch_2.pth \\\n",
        "  work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "zlrOaDo6tQtr",
      "metadata": {
        "id": "zlrOaDo6tQtr"
      },
      "source": [
        "### Prepare config file\n",
        "\n",
        "Here we create a new config file for demo dataset, actually we provided various config files in directory `configs/benchmarks`."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 17,
      "id": "tYVW1halrrtJ",
      "metadata": {
        "id": "tYVW1halrrtJ"
      },
      "outputs": [],
      "source": [
        "# Load the basic config file\n",
        "from mmcv import Config\n",
        "benchmark_cfg = Config.fromfile('configs/benchmarks/classification/imagenet/resnet50_linear-8xb32-steplr-100e_in1k.py')\n",
        "\n",
        "# Modify the model\n",
        "checkpoint_file = 'work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth'\n",
        "# Or directly using pre-train model provided by us\n",
        "# checkpoint_file = 'https://download.openmmlab.com/mmselfsup/moco/mocov2_resnet50_8xb32-coslr-200e_in1k_20220225-89e03af4.pth'\n",
        "\n",
        "benchmark_cfg.model.backbone.frozen_stages=4\n",
        "benchmark_cfg.model.backbone.init_cfg = dict(type='Pretrained', checkpoint=checkpoint_file)\n",
        "\n",
        "# As the imagenet_examples dataset folder doesn't have val dataset\n",
        "# Modify the path and meta files of validation dataset\n",
        "benchmark_cfg.data.val.data_source.data_prefix = 'data/imagenet/train'\n",
        "benchmark_cfg.data.val.data_source.ann_file = 'data/imagenet/meta/train.txt'\n",
        "\n",
        "# Specify the learning rate scheduler\n",
        "benchmark_cfg.lr_config = dict(policy='step', step=[1])\n",
        "\n",
        "# Output logs for every 10 iterations\n",
        "benchmark_cfg.log_config.interval = 10\n",
        "\n",
        "# Modify runtime settings for demo\n",
        "benchmark_cfg.runner = dict(type='EpochBasedRunner', max_epochs=2)\n",
        "\n",
        "# Specify the work directory\n",
        "benchmark_cfg.work_dir = './work_dirs/benchmarks/classification/imagenet/resnet50_8xb32-steplr-100e_in1k_colab'\n",
        "\n",
        "# Set the random seed and enable the deterministic option of cuDNN\n",
        "# to keep the results' reproducible.\n",
        "from mmselfsup.apis import set_random_seed\n",
        "benchmark_cfg.seed = 0\n",
        "set_random_seed(0, deterministic=True)\n",
        "\n",
        "benchmark_cfg.gpu_ids = range(1)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "9SeQvcRgzSgZ",
      "metadata": {
        "id": "9SeQvcRgzSgZ"
      },
      "source": [
        "### Load extracted backbone weights to start a downstream task"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 18,
      "id": "ZmqFyBjYu8Cx",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ZmqFyBjYu8Cx",
        "outputId": "ba933799-e4c9-48ac-b244-454548dbd2c6"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "2022-03-25 05:25:22,114 - mmcv - INFO - initialize ResNet with init_cfg {'type': 'Pretrained', 'checkpoint': 'work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth'}\n",
            "2022-03-25 05:25:22,116 - mmcv - INFO - load model from: work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth\n",
            "2022-03-25 05:25:22,122 - mmcv - INFO - load checkpoint from local path: work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth\n",
            "2022-03-25 05:25:22,264 - mmcv - INFO - initialize ClsHead with init_cfg [{'type': 'Normal', 'std': 0.01, 'layer': 'Linear'}, {'type': 'Constant', 'val': 1, 'layer': ['_BatchNorm', 'GroupNorm']}]\n",
            "2022-03-25 05:25:22,285 - mmcv - INFO - \n",
            "backbone.conv1.weight - torch.Size([64, 3, 7, 7]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,287 - mmcv - INFO - \n",
            "backbone.bn1.weight - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,290 - mmcv - INFO - \n",
            "backbone.bn1.bias - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,291 - mmcv - INFO - \n",
            "backbone.layer1.0.conv1.weight - torch.Size([64, 64, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,298 - mmcv - INFO - \n",
            "backbone.layer1.0.bn1.weight - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,299 - mmcv - INFO - \n",
            "backbone.layer1.0.bn1.bias - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,303 - mmcv - INFO - \n",
            "backbone.layer1.0.conv2.weight - torch.Size([64, 64, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,308 - mmcv - INFO - \n",
            "backbone.layer1.0.bn2.weight - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,311 - mmcv - INFO - \n",
            "backbone.layer1.0.bn2.bias - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,312 - mmcv - INFO - \n",
            "backbone.layer1.0.conv3.weight - torch.Size([256, 64, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,314 - mmcv - INFO - \n",
            "backbone.layer1.0.bn3.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,316 - mmcv - INFO - \n",
            "backbone.layer1.0.bn3.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,317 - mmcv - INFO - \n",
            "backbone.layer1.0.downsample.0.weight - torch.Size([256, 64, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,319 - mmcv - INFO - \n",
            "backbone.layer1.0.downsample.1.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,321 - mmcv - INFO - \n",
            "backbone.layer1.0.downsample.1.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,327 - mmcv - INFO - \n",
            "backbone.layer1.1.conv1.weight - torch.Size([64, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,332 - mmcv - INFO - \n",
            "backbone.layer1.1.bn1.weight - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,334 - mmcv - INFO - \n",
            "backbone.layer1.1.bn1.bias - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,335 - mmcv - INFO - \n",
            "backbone.layer1.1.conv2.weight - torch.Size([64, 64, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,337 - mmcv - INFO - \n",
            "backbone.layer1.1.bn2.weight - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,340 - mmcv - INFO - \n",
            "backbone.layer1.1.bn2.bias - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,342 - mmcv - INFO - \n",
            "backbone.layer1.1.conv3.weight - torch.Size([256, 64, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,345 - mmcv - INFO - \n",
            "backbone.layer1.1.bn3.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,346 - mmcv - INFO - \n",
            "backbone.layer1.1.bn3.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,348 - mmcv - INFO - \n",
            "backbone.layer1.2.conv1.weight - torch.Size([64, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,351 - mmcv - INFO - \n",
            "backbone.layer1.2.bn1.weight - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,353 - mmcv - INFO - \n",
            "backbone.layer1.2.bn1.bias - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,355 - mmcv - INFO - \n",
            "backbone.layer1.2.conv2.weight - torch.Size([64, 64, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,358 - mmcv - INFO - \n",
            "backbone.layer1.2.bn2.weight - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,360 - mmcv - INFO - \n",
            "backbone.layer1.2.bn2.bias - torch.Size([64]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,361 - mmcv - INFO - \n",
            "backbone.layer1.2.conv3.weight - torch.Size([256, 64, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,362 - mmcv - INFO - \n",
            "backbone.layer1.2.bn3.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,364 - mmcv - INFO - \n",
            "backbone.layer1.2.bn3.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,366 - mmcv - INFO - \n",
            "backbone.layer2.0.conv1.weight - torch.Size([128, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,368 - mmcv - INFO - \n",
            "backbone.layer2.0.bn1.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,369 - mmcv - INFO - \n",
            "backbone.layer2.0.bn1.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,371 - mmcv - INFO - \n",
            "backbone.layer2.0.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,373 - mmcv - INFO - \n",
            "backbone.layer2.0.bn2.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,375 - mmcv - INFO - \n",
            "backbone.layer2.0.bn2.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,377 - mmcv - INFO - \n",
            "backbone.layer2.0.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,381 - mmcv - INFO - \n",
            "backbone.layer2.0.bn3.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,385 - mmcv - INFO - \n",
            "backbone.layer2.0.bn3.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,387 - mmcv - INFO - \n",
            "backbone.layer2.0.downsample.0.weight - torch.Size([512, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,388 - mmcv - INFO - \n",
            "backbone.layer2.0.downsample.1.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,390 - mmcv - INFO - \n",
            "backbone.layer2.0.downsample.1.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,391 - mmcv - INFO - \n",
            "backbone.layer2.1.conv1.weight - torch.Size([128, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,393 - mmcv - INFO - \n",
            "backbone.layer2.1.bn1.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,394 - mmcv - INFO - \n",
            "backbone.layer2.1.bn1.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,396 - mmcv - INFO - \n",
            "backbone.layer2.1.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,397 - mmcv - INFO - \n",
            "backbone.layer2.1.bn2.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,398 - mmcv - INFO - \n",
            "backbone.layer2.1.bn2.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,400 - mmcv - INFO - \n",
            "backbone.layer2.1.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,401 - mmcv - INFO - \n",
            "backbone.layer2.1.bn3.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,403 - mmcv - INFO - \n",
            "backbone.layer2.1.bn3.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,404 - mmcv - INFO - \n",
            "backbone.layer2.2.conv1.weight - torch.Size([128, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,406 - mmcv - INFO - \n",
            "backbone.layer2.2.bn1.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,407 - mmcv - INFO - \n",
            "backbone.layer2.2.bn1.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,409 - mmcv - INFO - \n",
            "backbone.layer2.2.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,410 - mmcv - INFO - \n",
            "backbone.layer2.2.bn2.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,412 - mmcv - INFO - \n",
            "backbone.layer2.2.bn2.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,413 - mmcv - INFO - \n",
            "backbone.layer2.2.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,415 - mmcv - INFO - \n",
            "backbone.layer2.2.bn3.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,416 - mmcv - INFO - \n",
            "backbone.layer2.2.bn3.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,418 - mmcv - INFO - \n",
            "backbone.layer2.3.conv1.weight - torch.Size([128, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,419 - mmcv - INFO - \n",
            "backbone.layer2.3.bn1.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,421 - mmcv - INFO - \n",
            "backbone.layer2.3.bn1.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,422 - mmcv - INFO - \n",
            "backbone.layer2.3.conv2.weight - torch.Size([128, 128, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,424 - mmcv - INFO - \n",
            "backbone.layer2.3.bn2.weight - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,425 - mmcv - INFO - \n",
            "backbone.layer2.3.bn2.bias - torch.Size([128]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,427 - mmcv - INFO - \n",
            "backbone.layer2.3.conv3.weight - torch.Size([512, 128, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,428 - mmcv - INFO - \n",
            "backbone.layer2.3.bn3.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,430 - mmcv - INFO - \n",
            "backbone.layer2.3.bn3.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,431 - mmcv - INFO - \n",
            "backbone.layer3.0.conv1.weight - torch.Size([256, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,433 - mmcv - INFO - \n",
            "backbone.layer3.0.bn1.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,434 - mmcv - INFO - \n",
            "backbone.layer3.0.bn1.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,436 - mmcv - INFO - \n",
            "backbone.layer3.0.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,437 - mmcv - INFO - \n",
            "backbone.layer3.0.bn2.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,439 - mmcv - INFO - \n",
            "backbone.layer3.0.bn2.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,440 - mmcv - INFO - \n",
            "backbone.layer3.0.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,442 - mmcv - INFO - \n",
            "backbone.layer3.0.bn3.weight - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,443 - mmcv - INFO - \n",
            "backbone.layer3.0.bn3.bias - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,445 - mmcv - INFO - \n",
            "backbone.layer3.0.downsample.0.weight - torch.Size([1024, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,446 - mmcv - INFO - \n",
            "backbone.layer3.0.downsample.1.weight - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,448 - mmcv - INFO - \n",
            "backbone.layer3.0.downsample.1.bias - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,449 - mmcv - INFO - \n",
            "backbone.layer3.1.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,451 - mmcv - INFO - \n",
            "backbone.layer3.1.bn1.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,452 - mmcv - INFO - \n",
            "backbone.layer3.1.bn1.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,454 - mmcv - INFO - \n",
            "backbone.layer3.1.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,456 - mmcv - INFO - \n",
            "backbone.layer3.1.bn2.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,457 - mmcv - INFO - \n",
            "backbone.layer3.1.bn2.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,458 - mmcv - INFO - \n",
            "backbone.layer3.1.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,460 - mmcv - INFO - \n",
            "backbone.layer3.1.bn3.weight - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,461 - mmcv - INFO - \n",
            "backbone.layer3.1.bn3.bias - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,463 - mmcv - INFO - \n",
            "backbone.layer3.2.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,464 - mmcv - INFO - \n",
            "backbone.layer3.2.bn1.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,466 - mmcv - INFO - \n",
            "backbone.layer3.2.bn1.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,467 - mmcv - INFO - \n",
            "backbone.layer3.2.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,469 - mmcv - INFO - \n",
            "backbone.layer3.2.bn2.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,471 - mmcv - INFO - \n",
            "backbone.layer3.2.bn2.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,472 - mmcv - INFO - \n",
            "backbone.layer3.2.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,474 - mmcv - INFO - \n",
            "backbone.layer3.2.bn3.weight - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,475 - mmcv - INFO - \n",
            "backbone.layer3.2.bn3.bias - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,477 - mmcv - INFO - \n",
            "backbone.layer3.3.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,478 - mmcv - INFO - \n",
            "backbone.layer3.3.bn1.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,480 - mmcv - INFO - \n",
            "backbone.layer3.3.bn1.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,481 - mmcv - INFO - \n",
            "backbone.layer3.3.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,482 - mmcv - INFO - \n",
            "backbone.layer3.3.bn2.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,484 - mmcv - INFO - \n",
            "backbone.layer3.3.bn2.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,485 - mmcv - INFO - \n",
            "backbone.layer3.3.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,487 - mmcv - INFO - \n",
            "backbone.layer3.3.bn3.weight - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,489 - mmcv - INFO - \n",
            "backbone.layer3.3.bn3.bias - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,490 - mmcv - INFO - \n",
            "backbone.layer3.4.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,492 - mmcv - INFO - \n",
            "backbone.layer3.4.bn1.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,493 - mmcv - INFO - \n",
            "backbone.layer3.4.bn1.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,495 - mmcv - INFO - \n",
            "backbone.layer3.4.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,496 - mmcv - INFO - \n",
            "backbone.layer3.4.bn2.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,498 - mmcv - INFO - \n",
            "backbone.layer3.4.bn2.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,499 - mmcv - INFO - \n",
            "backbone.layer3.4.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,501 - mmcv - INFO - \n",
            "backbone.layer3.4.bn3.weight - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,502 - mmcv - INFO - \n",
            "backbone.layer3.4.bn3.bias - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,504 - mmcv - INFO - \n",
            "backbone.layer3.5.conv1.weight - torch.Size([256, 1024, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,505 - mmcv - INFO - \n",
            "backbone.layer3.5.bn1.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,507 - mmcv - INFO - \n",
            "backbone.layer3.5.bn1.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,508 - mmcv - INFO - \n",
            "backbone.layer3.5.conv2.weight - torch.Size([256, 256, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,510 - mmcv - INFO - \n",
            "backbone.layer3.5.bn2.weight - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,511 - mmcv - INFO - \n",
            "backbone.layer3.5.bn2.bias - torch.Size([256]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,513 - mmcv - INFO - \n",
            "backbone.layer3.5.conv3.weight - torch.Size([1024, 256, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,514 - mmcv - INFO - \n",
            "backbone.layer3.5.bn3.weight - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,515 - mmcv - INFO - \n",
            "backbone.layer3.5.bn3.bias - torch.Size([1024]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,517 - mmcv - INFO - \n",
            "backbone.layer4.0.conv1.weight - torch.Size([512, 1024, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,518 - mmcv - INFO - \n",
            "backbone.layer4.0.bn1.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,520 - mmcv - INFO - \n",
            "backbone.layer4.0.bn1.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,521 - mmcv - INFO - \n",
            "backbone.layer4.0.conv2.weight - torch.Size([512, 512, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,523 - mmcv - INFO - \n",
            "backbone.layer4.0.bn2.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,524 - mmcv - INFO - \n",
            "backbone.layer4.0.bn2.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,526 - mmcv - INFO - \n",
            "backbone.layer4.0.conv3.weight - torch.Size([2048, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,527 - mmcv - INFO - \n",
            "backbone.layer4.0.bn3.weight - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,529 - mmcv - INFO - \n",
            "backbone.layer4.0.bn3.bias - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,530 - mmcv - INFO - \n",
            "backbone.layer4.0.downsample.0.weight - torch.Size([2048, 1024, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,532 - mmcv - INFO - \n",
            "backbone.layer4.0.downsample.1.weight - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,533 - mmcv - INFO - \n",
            "backbone.layer4.0.downsample.1.bias - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,535 - mmcv - INFO - \n",
            "backbone.layer4.1.conv1.weight - torch.Size([512, 2048, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,536 - mmcv - INFO - \n",
            "backbone.layer4.1.bn1.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,538 - mmcv - INFO - \n",
            "backbone.layer4.1.bn1.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,539 - mmcv - INFO - \n",
            "backbone.layer4.1.conv2.weight - torch.Size([512, 512, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,540 - mmcv - INFO - \n",
            "backbone.layer4.1.bn2.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,542 - mmcv - INFO - \n",
            "backbone.layer4.1.bn2.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,543 - mmcv - INFO - \n",
            "backbone.layer4.1.conv3.weight - torch.Size([2048, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,545 - mmcv - INFO - \n",
            "backbone.layer4.1.bn3.weight - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,546 - mmcv - INFO - \n",
            "backbone.layer4.1.bn3.bias - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,548 - mmcv - INFO - \n",
            "backbone.layer4.2.conv1.weight - torch.Size([512, 2048, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,550 - mmcv - INFO - \n",
            "backbone.layer4.2.bn1.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,551 - mmcv - INFO - \n",
            "backbone.layer4.2.bn1.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,553 - mmcv - INFO - \n",
            "backbone.layer4.2.conv2.weight - torch.Size([512, 512, 3, 3]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,554 - mmcv - INFO - \n",
            "backbone.layer4.2.bn2.weight - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,556 - mmcv - INFO - \n",
            "backbone.layer4.2.bn2.bias - torch.Size([512]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,557 - mmcv - INFO - \n",
            "backbone.layer4.2.conv3.weight - torch.Size([2048, 512, 1, 1]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,559 - mmcv - INFO - \n",
            "backbone.layer4.2.bn3.weight - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,560 - mmcv - INFO - \n",
            "backbone.layer4.2.bn3.bias - torch.Size([2048]): \n",
            "PretrainedInit: load from work_dirs/selfsup/relative-loc_resnet50_8xb64-steplr-70e_in1k_colab/relative-loc_backbone-weights.pth \n",
            " \n",
            "2022-03-25 05:25:22,561 - mmcv - INFO - \n",
            "head.fc_cls.weight - torch.Size([1000, 2048]): \n",
            "NormalInit: mean=0, std=0.01, bias=0 \n",
            " \n",
            "2022-03-25 05:25:22,563 - mmcv - INFO - \n",
            "head.fc_cls.bias - torch.Size([1000]): \n",
            "NormalInit: mean=0, std=0.01, bias=0 \n",
            " \n",
            "/content/mmselfsup/mmselfsup/datasets/base.py:29: UserWarning: The dataset part will be refactored, it will soon support `dict` in pipelines to save more information, the same as the pipeline in `MMDet`.\n",
            "  warnings.warn('The dataset part will be refactored, it will soon '\n",
            "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py:481: UserWarning: This DataLoader will create 4 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.\n",
            "  cpuset_checked))\n",
            "2022-03-25 05:25:22,924 - mmselfsup - INFO - Start running, host: root@f8465e2b77d5, work_dir: /content/mmselfsup/work_dirs/benchmarks/classification/imagenet/resnet50_8xb32-steplr-100e_in1k_colab\n",
            "2022-03-25 05:25:22,943 - mmselfsup - INFO - Hooks will be executed in the following order:\n",
            "before_run:\n",
            "(VERY_HIGH   ) StepLrUpdaterHook                  \n",
            "(NORMAL      ) CheckpointHook                     \n",
            "(LOW         ) EvalHook                           \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_train_epoch:\n",
            "(VERY_HIGH   ) StepLrUpdaterHook                  \n",
            "(LOW         ) IterTimerHook                      \n",
            "(LOW         ) EvalHook                           \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_train_iter:\n",
            "(VERY_HIGH   ) StepLrUpdaterHook                  \n",
            "(LOW         ) IterTimerHook                      \n",
            "(LOW         ) EvalHook                           \n",
            " -------------------- \n",
            "after_train_iter:\n",
            "(ABOVE_NORMAL) OptimizerHook                      \n",
            "(NORMAL      ) CheckpointHook                     \n",
            "(LOW         ) IterTimerHook                      \n",
            "(LOW         ) EvalHook                           \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "after_train_epoch:\n",
            "(NORMAL      ) CheckpointHook                     \n",
            "(LOW         ) EvalHook                           \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_val_epoch:\n",
            "(LOW         ) IterTimerHook                      \n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "before_val_iter:\n",
            "(LOW         ) IterTimerHook                      \n",
            " -------------------- \n",
            "after_val_iter:\n",
            "(LOW         ) IterTimerHook                      \n",
            " -------------------- \n",
            "after_val_epoch:\n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "after_run:\n",
            "(VERY_LOW    ) TextLoggerHook                     \n",
            " -------------------- \n",
            "2022-03-25 05:25:22,944 - mmselfsup - INFO - workflow: [('train', 1)], max: 2 epochs\n",
            "2022-03-25 05:25:22,946 - mmselfsup - INFO - Checkpoints will be saved to /content/mmselfsup/work_dirs/benchmarks/classification/imagenet/resnet50_8xb32-steplr-100e_in1k_colab by HardDiskBackend.\n",
            "2022-03-25 05:25:31,635 - mmselfsup - INFO - Epoch [1][10/41]\tlr: 3.000e+01, eta: 0:01:02, time: 0.868, data_time: 0.603, memory: 7428, loss: 0.8637, acc: 90.0000\n",
            "2022-03-25 05:25:35,253 - mmselfsup - INFO - Epoch [1][20/41]\tlr: 3.000e+01, eta: 0:00:38, time: 0.362, data_time: 0.107, memory: 7428, loss: 0.0000, acc: 100.0000\n",
            "2022-03-25 05:25:39,915 - mmselfsup - INFO - Epoch [1][30/41]\tlr: 3.000e+01, eta: 0:00:29, time: 0.466, data_time: 0.223, memory: 7428, loss: 0.0000, acc: 100.0000\n",
            "2022-03-25 05:25:43,426 - mmselfsup - INFO - Epoch [1][40/41]\tlr: 3.000e+01, eta: 0:00:21, time: 0.351, data_time: 0.106, memory: 7428, loss: 0.0000, acc: 100.0000\n"
          ]
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 41/41, 1.9 task/s, elapsed: 21s, ETA:     0s"
          ]
        },
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "2022-03-25 05:26:04,802 - mmselfsup - INFO - head4_top1: 100.000\n",
            "2022-03-25 05:26:04,804 - mmselfsup - INFO - head4_top5: 100.000\n",
            "2022-03-25 05:26:04,807 - mmselfsup - INFO - Epoch(val) [1][41]\thead4_top1: 100.0000, head4_top5: 100.0000\n",
            "2022-03-25 05:26:12,294 - mmselfsup - INFO - Epoch [2][10/41]\tlr: 3.000e+00, eta: 0:00:16, time: 0.748, data_time: 0.482, memory: 7428, loss: 0.0000, acc: 100.0000\n",
            "2022-03-25 05:26:16,236 - mmselfsup - INFO - Epoch [2][20/41]\tlr: 3.000e+00, eta: 0:00:10, time: 0.394, data_time: 0.148, memory: 7428, loss: 0.0000, acc: 100.0000\n",
            "2022-03-25 05:26:20,883 - mmselfsup - INFO - Epoch [2][30/41]\tlr: 3.000e+00, eta: 0:00:05, time: 0.465, data_time: 0.215, memory: 7428, loss: 0.0000, acc: 100.0000\n",
            "2022-03-25 05:26:24,566 - mmselfsup - INFO - Epoch [2][40/41]\tlr: 3.000e+00, eta: 0:00:00, time: 0.368, data_time: 0.124, memory: 7428, loss: 0.0000, acc: 100.0000\n",
            "2022-03-25 05:26:24,736 - mmselfsup - INFO - Saving checkpoint at 2 epochs\n"
          ]
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 41/41, 2.1 task/s, elapsed: 20s, ETA:     0s"
          ]
        },
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "2022-03-25 05:26:45,476 - mmselfsup - INFO - head4_top1: 100.000\n",
            "2022-03-25 05:26:45,477 - mmselfsup - INFO - head4_top5: 100.000\n",
            "2022-03-25 05:26:45,480 - mmselfsup - INFO - Epoch(val) [2][41]\thead4_top1: 100.0000, head4_top5: 100.0000\n"
          ]
        }
      ],
      "source": [
        "import time\n",
        "import mmcv\n",
        "import os.path as osp\n",
        "\n",
        "from mmselfsup.datasets import build_dataset\n",
        "from mmselfsup.models import build_algorithm\n",
        "from mmselfsup.apis import train_model\n",
        "\n",
        "# Create the work directory\n",
        "mmcv.mkdir_or_exist(osp.abspath(benchmark_cfg.work_dir))\n",
        "\n",
        "# Build the algorithm\n",
        "model = build_algorithm(benchmark_cfg.model)\n",
        "model.init_weights()\n",
        "\n",
        "# Build the dataset\n",
        "datasets = [build_dataset(benchmark_cfg.data.train)]\n",
        "\n",
        "# Start linear probing\n",
        "train_model(\n",
        "    model,\n",
        "    datasets,\n",
        "    benchmark_cfg,\n",
        "    distributed=False,\n",
        "    timestamp=time.strftime('%Y%m%d_%H%M%S', time.localtime()),\n",
        "    meta=dict())"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "3DUKbf3Rs2D_",
      "metadata": {
        "id": "3DUKbf3Rs2D_"
      },
      "source": [
        "**Note: As the demo only has one class in dataset, the model collapsed and the results of loss and acc should be ignored.**"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "collapsed_sections": [],
      "name": "mmselfsup_colab_tutorial.ipynb",
      "provenance": [],
      "toc_visible": true
    },
    "kernelspec": {
      "display_name": "Python 3 (ipykernel)",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.8.12"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
