{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(0.8943)\n"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "\n",
    "# 假設有3個類別\n",
    "num_classes = 3\n",
    "batch_size = 4\n",
    "\n",
    "# 模擬模型輸出 (未經softmax)\n",
    "# 輸出形狀應為 [batch_size, num_classes]\n",
    "predictions = torch.randn(batch_size, num_classes)\n",
    "\n",
    "# 模擬真實標籤，假設為one-hot編碼\n",
    "# 形狀為 [batch_size, num_classes]\n",
    "targets_one_hot = torch.tensor([\n",
    "    [1, 0, 0],\n",
    "    [0, 1, 0],\n",
    "    [0, 0, 1],\n",
    "    [0, 1, 0]\n",
    "], dtype=torch.float32)\n",
    "\n",
    "# 將one-hot編碼的標籤轉換為類別索引\n",
    "# 形狀為 [batch_size]\n",
    "targets = torch.argmax(targets_one_hot, dim=1)\n",
    "\n",
    "# 定義損失函數\n",
    "criterion = nn.CrossEntropyLoss()\n",
    "\n",
    "# 計算損失\n",
    "loss = criterion(predictions, targets)\n",
    "print(loss)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[-0.2698,  0.7174, -0.2358],\n",
       "        [ 1.4976, -1.1554,  3.3826],\n",
       "        [-0.8067,  1.1254,  1.9788],\n",
       "        [ 1.3467,  0.7573, -1.5764]])"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "predictions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([0, 1, 2, 1])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "targets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<generator object <genexpr> at 0x7fd0786385f0>\n"
     ]
    }
   ],
   "source": [
    "print(x for x in range(1, 76))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.optim as optim\n",
    "import torchvision.transforms as transforms\n",
    "from torchvision import models\n",
    "import timm\n",
    "\n",
    "\n",
    "class ModifiedXception(nn.Module):\n",
    "    def __init__(self, num_classes):\n",
    "        super(ModifiedXception, self).__init__()\n",
    "        \n",
    "        # 加載 Xception 預訓練模型，去掉最後一層 (fc 層)\n",
    "        self.base_model = timm.create_model(\n",
    "            'xception', \n",
    "            pretrained=True, \n",
    "            features_only=True, # 只保留特徵提取部分\n",
    "            out_indices=[3] # 選擇特徵層索引（根據模型結構）\n",
    "            )\n",
    "        \n",
    "        # 自定義分類頭\n",
    "        self.custom_head = nn.Sequential(\n",
    "            nn.AdaptiveAvgPool2d(1),  # Global Average Pooling,\n",
    "            nn.Flatten(),\n",
    "            nn.Linear(728, 368),    # Xception 輸出特徵維度為2048\n",
    "            nn.ReLU(),               # 可選激活函數\n",
    "            nn.Linear(368, num_classes),\n",
    "            nn.Sigmoid()\n",
    "        )\n",
    "\n",
    "        # self.base_model.fc = nn.Identity()  # 移除原來的 fully connected 層\n",
    "        \n",
    "        # # 新增全局平均池化層、隱藏層和輸出層\n",
    "        # self.global_avg_pool = nn.AdaptiveAvgPool2d(1)  # 全局平均池化\n",
    "        # self.hidden_layer = nn.Linear(2048, 1370)  # 隱藏層，輸入大小取決於 Xception 的輸出大小\n",
    "        # self.output_layer = nn.Linear(1370, 2)  # 輸出層，依據分類數目設定\n",
    "        \n",
    "        # # 激活函數與 dropout\n",
    "        # self.relu = nn.ReLU()\n",
    "        # self.dropout = nn.Dropout(0.6)\n",
    "\n",
    "    def forward(self, x):\n",
    "        x = self.base_model(x)               # Xception 主體\n",
    "        return x\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.11/site-packages/timm/models/_factory.py:126: UserWarning: Mapping deprecated model name xception to current legacy_xception.\n",
      "  model = create_fn(\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'num_chs': 64, 'reduction': 2, 'module': 'act2', 'index': 0}\n",
      "{'num_chs': 128, 'reduction': 4, 'module': 'block2.rep.0', 'index': 1}\n",
      "{'num_chs': 256, 'reduction': 8, 'module': 'block3.rep.0', 'index': 2}\n",
      "{'num_chs': 728, 'reduction': 16, 'module': 'block12.rep.0', 'index': 3}\n",
      "{'num_chs': 2048, 'reduction': 32, 'module': 'act4', 'index': 4}\n"
     ]
    }
   ],
   "source": [
    "def construct_model():\n",
    "    '''決定我這次訓練要用哪個model'''\n",
    "    cnn_model = ModifiedXception(3)\n",
    "\n",
    "    if torch.cuda.device_count() > 1:\n",
    "        cnn_model = nn.DataParallel(cnn_model)\n",
    "\n",
    "    cnn_model = cnn_model.to(torch.device('cuda' if torch.cuda.is_available() else 'cpu'))\n",
    "    return cnn_model\n",
    "\n",
    "model = construct_model()\n",
    "a = model.base_model.feature_info\n",
    "\n",
    "for b in a:\n",
    "    print(b)\n",
    "\n",
    "# last = a[-1]\n",
    "# last_conv_name = last['module']  # 這通常是 PyTorch Module 的名稱\n",
    "\n",
    "# last_layer = dict(model.base_model.named_modules()).get(last_conv_name)\n",
    "# print(f\"最後的卷積層: {last_layer}\")\n",
    "\n",
    "# print(last_conv_name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " ModifiedXception(\n",
      "  (base_model): FeatureHookNet(\n",
      "    (body): Xception(\n",
      "      (conv1): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "      (bn1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (act1): ReLU(inplace=True)\n",
      "      (conv2): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), bias=False)\n",
      "      (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (act2): ReLU(inplace=True)\n",
      "      (block1): Block(\n",
      "        (skip): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "        (skipbn): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (rep): Sequential(\n",
      "          (0): SeparableConv2d(\n",
      "            (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64, bias=False)\n",
      "            (pointwise): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (2): ReLU(inplace=True)\n",
      "          (3): SeparableConv2d(\n",
      "            (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "            (pointwise): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (4): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (5): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "        )\n",
      "      )\n",
      "      (block2): Block(\n",
      "        (skip): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "        (skipbn): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "            (pointwise): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "            (pointwise): Conv2d(256, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "        )\n",
      "      )\n",
      "      (block3): Block(\n",
      "        (skip): Conv2d(256, 728, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "        (skipbn): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "            (pointwise): Conv2d(256, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "        )\n",
      "      )\n",
      "      (block4): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block5): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block6): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block7): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block8): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block9): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block10): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block11): Block(\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): ReLU(inplace=True)\n",
      "          (7): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        )\n",
      "      )\n",
      "      (block12): Block(\n",
      "        (skip): Conv2d(728, 1024, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "        (skipbn): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (rep): Sequential(\n",
      "          (0): ReLU()\n",
      "          (1): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (3): ReLU(inplace=True)\n",
      "          (4): SeparableConv2d(\n",
      "            (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "            (pointwise): Conv2d(728, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "          )\n",
      "          (5): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "          (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "        )\n",
      "      )\n",
      "      (conv3): SeparableConv2d(\n",
      "        (conv1): Conv2d(1024, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1024, bias=False)\n",
      "        (pointwise): Conv2d(1024, 1536, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (bn3): BatchNorm2d(1536, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (act3): ReLU(inplace=True)\n",
      "      (conv4): SeparableConv2d(\n",
      "        (conv1): Conv2d(1536, 1536, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1536, bias=False)\n",
      "        (pointwise): Conv2d(1536, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (bn4): BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (act4): ReLU(inplace=True)\n",
      "      (global_pool): SelectAdaptivePool2d(pool_type=avg, flatten=Flatten(start_dim=1, end_dim=-1))\n",
      "      (fc): Identity()\n",
      "    )\n",
      "  )\n",
      "  (custom_head): Sequential(\n",
      "    (0): AdaptiveAvgPool2d(output_size=1)\n",
      "    (1): Flatten(start_dim=1, end_dim=-1)\n",
      "    (2): Linear(in_features=728, out_features=368, bias=True)\n",
      "    (3): ReLU()\n",
      "    (4): Linear(in_features=368, out_features=3, bias=True)\n",
      "    (5): Sigmoid()\n",
      "  )\n",
      ")\n",
      "base_model FeatureHookNet(\n",
      "  (body): Xception(\n",
      "    (conv1): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "    (bn1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (act1): ReLU(inplace=True)\n",
      "    (conv2): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), bias=False)\n",
      "    (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (act2): ReLU(inplace=True)\n",
      "    (block1): Block(\n",
      "      (skip): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "      (skipbn): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (rep): Sequential(\n",
      "        (0): SeparableConv2d(\n",
      "          (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64, bias=False)\n",
      "          (pointwise): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (2): ReLU(inplace=True)\n",
      "        (3): SeparableConv2d(\n",
      "          (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "          (pointwise): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (4): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (5): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "      )\n",
      "    )\n",
      "    (block2): Block(\n",
      "      (skip): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "      (skipbn): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "          (pointwise): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "          (pointwise): Conv2d(256, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "      )\n",
      "    )\n",
      "    (block3): Block(\n",
      "      (skip): Conv2d(256, 728, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "      (skipbn): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "          (pointwise): Conv2d(256, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "      )\n",
      "    )\n",
      "    (block4): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block5): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block6): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block7): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block8): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block9): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block10): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block11): Block(\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): ReLU(inplace=True)\n",
      "        (7): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      )\n",
      "    )\n",
      "    (block12): Block(\n",
      "      (skip): Conv2d(728, 1024, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "      (skipbn): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (rep): Sequential(\n",
      "        (0): ReLU()\n",
      "        (1): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (3): ReLU(inplace=True)\n",
      "        (4): SeparableConv2d(\n",
      "          (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "          (pointwise): Conv2d(728, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "        )\n",
      "        (5): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "        (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "      )\n",
      "    )\n",
      "    (conv3): SeparableConv2d(\n",
      "      (conv1): Conv2d(1024, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1024, bias=False)\n",
      "      (pointwise): Conv2d(1024, 1536, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (bn3): BatchNorm2d(1536, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (act3): ReLU(inplace=True)\n",
      "    (conv4): SeparableConv2d(\n",
      "      (conv1): Conv2d(1536, 1536, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1536, bias=False)\n",
      "      (pointwise): Conv2d(1536, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (bn4): BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (act4): ReLU(inplace=True)\n",
      "    (global_pool): SelectAdaptivePool2d(pool_type=avg, flatten=Flatten(start_dim=1, end_dim=-1))\n",
      "    (fc): Identity()\n",
      "  )\n",
      ")\n",
      "base_model.body Xception(\n",
      "  (conv1): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "  (bn1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (act1): ReLU(inplace=True)\n",
      "  (conv2): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), bias=False)\n",
      "  (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (act2): ReLU(inplace=True)\n",
      "  (block1): Block(\n",
      "    (skip): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "    (skipbn): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (rep): Sequential(\n",
      "      (0): SeparableConv2d(\n",
      "        (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64, bias=False)\n",
      "        (pointwise): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (2): ReLU(inplace=True)\n",
      "      (3): SeparableConv2d(\n",
      "        (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "        (pointwise): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (4): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (5): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "    )\n",
      "  )\n",
      "  (block2): Block(\n",
      "    (skip): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "    (skipbn): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "        (pointwise): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "        (pointwise): Conv2d(256, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "    )\n",
      "  )\n",
      "  (block3): Block(\n",
      "    (skip): Conv2d(256, 728, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "    (skipbn): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "        (pointwise): Conv2d(256, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "    )\n",
      "  )\n",
      "  (block4): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block5): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block6): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block7): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block8): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block9): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block10): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block11): Block(\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): ReLU(inplace=True)\n",
      "      (7): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    )\n",
      "  )\n",
      "  (block12): Block(\n",
      "    (skip): Conv2d(728, 1024, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "    (skipbn): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (rep): Sequential(\n",
      "      (0): ReLU()\n",
      "      (1): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (3): ReLU(inplace=True)\n",
      "      (4): SeparableConv2d(\n",
      "        (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "        (pointwise): Conv2d(728, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "      )\n",
      "      (5): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "    )\n",
      "  )\n",
      "  (conv3): SeparableConv2d(\n",
      "    (conv1): Conv2d(1024, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1024, bias=False)\n",
      "    (pointwise): Conv2d(1024, 1536, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (bn3): BatchNorm2d(1536, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (act3): ReLU(inplace=True)\n",
      "  (conv4): SeparableConv2d(\n",
      "    (conv1): Conv2d(1536, 1536, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1536, bias=False)\n",
      "    (pointwise): Conv2d(1536, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (bn4): BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (act4): ReLU(inplace=True)\n",
      "  (global_pool): SelectAdaptivePool2d(pool_type=avg, flatten=Flatten(start_dim=1, end_dim=-1))\n",
      "  (fc): Identity()\n",
      ")\n",
      "base_model.body.conv1 Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)\n",
      "base_model.body.bn1 BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.act1 ReLU(inplace=True)\n",
      "base_model.body.conv2 Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), bias=False)\n",
      "base_model.body.bn2 BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.act2 ReLU(inplace=True)\n",
      "base_model.body.block1 Block(\n",
      "  (skip): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "  (skipbn): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (rep): Sequential(\n",
      "    (0): SeparableConv2d(\n",
      "      (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64, bias=False)\n",
      "      (pointwise): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (2): ReLU(inplace=True)\n",
      "    (3): SeparableConv2d(\n",
      "      (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "      (pointwise): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (4): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (5): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "  )\n",
      ")\n",
      "base_model.body.block1.skip Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "base_model.body.block1.skipbn BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block1.rep Sequential(\n",
      "  (0): SeparableConv2d(\n",
      "    (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64, bias=False)\n",
      "    (pointwise): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (2): ReLU(inplace=True)\n",
      "  (3): SeparableConv2d(\n",
      "    (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "    (pointwise): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (4): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (5): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      ")\n",
      "base_model.body.block1.rep.0 SeparableConv2d(\n",
      "  (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64, bias=False)\n",
      "  (pointwise): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block1.rep.0.conv1 Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64, bias=False)\n",
      "base_model.body.block1.rep.0.pointwise Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block1.rep.1 BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block1.rep.2 ReLU(inplace=True)\n",
      "base_model.body.block1.rep.3 SeparableConv2d(\n",
      "  (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "  (pointwise): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block1.rep.3.conv1 Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "base_model.body.block1.rep.3.pointwise Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block1.rep.4 BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block1.rep.5 MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "base_model.body.block2 Block(\n",
      "  (skip): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "  (skipbn): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "      (pointwise): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "      (pointwise): Conv2d(256, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "  )\n",
      ")\n",
      "base_model.body.block2.skip Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "base_model.body.block2.skipbn BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block2.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "    (pointwise): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "    (pointwise): Conv2d(256, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      ")\n",
      "base_model.body.block2.rep.0 ReLU()\n",
      "base_model.body.block2.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "  (pointwise): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block2.rep.1.conv1 Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)\n",
      "base_model.body.block2.rep.1.pointwise Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block2.rep.2 BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block2.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block2.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "  (pointwise): Conv2d(256, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block2.rep.4.conv1 Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "base_model.body.block2.rep.4.pointwise Conv2d(256, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block2.rep.5 BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block2.rep.6 MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "base_model.body.block3 Block(\n",
      "  (skip): Conv2d(256, 728, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "  (skipbn): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "      (pointwise): Conv2d(256, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "  )\n",
      ")\n",
      "base_model.body.block3.skip Conv2d(256, 728, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "base_model.body.block3.skipbn BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block3.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "    (pointwise): Conv2d(256, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      ")\n",
      "base_model.body.block3.rep.0 ReLU()\n",
      "base_model.body.block3.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "  (pointwise): Conv2d(256, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block3.rep.1.conv1 Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256, bias=False)\n",
      "base_model.body.block3.rep.1.pointwise Conv2d(256, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block3.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block3.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block3.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block3.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block3.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block3.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block3.rep.6 MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "base_model.body.block4 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block4.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block4.rep.0 ReLU()\n",
      "base_model.body.block4.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block4.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block4.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block4.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block4.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block4.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block4.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block4.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block4.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block4.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block4.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block4.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block4.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block4.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block5 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block5.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block5.rep.0 ReLU()\n",
      "base_model.body.block5.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block5.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block5.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block5.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block5.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block5.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block5.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block5.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block5.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block5.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block5.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block5.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block5.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block5.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block6 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block6.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block6.rep.0 ReLU()\n",
      "base_model.body.block6.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block6.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block6.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block6.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block6.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block6.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block6.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block6.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block6.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block6.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block6.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block6.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block6.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block6.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block7 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block7.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block7.rep.0 ReLU()\n",
      "base_model.body.block7.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block7.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block7.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block7.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block7.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block7.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block7.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block7.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block7.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block7.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block7.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block7.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block7.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block7.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block8 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block8.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block8.rep.0 ReLU()\n",
      "base_model.body.block8.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block8.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block8.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block8.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block8.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block8.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block8.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block8.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block8.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block8.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block8.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block8.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block8.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block8.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block9 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block9.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block9.rep.0 ReLU()\n",
      "base_model.body.block9.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block9.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block9.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block9.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block9.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block9.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block9.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block9.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block9.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block9.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block9.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block9.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block9.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block9.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block10 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block10.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block10.rep.0 ReLU()\n",
      "base_model.body.block10.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block10.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block10.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block10.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block10.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block10.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block10.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block10.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block10.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block10.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block10.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block10.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block10.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block10.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block11 Block(\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): ReLU(inplace=True)\n",
      "    (7): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  )\n",
      ")\n",
      "base_model.body.block11.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): ReLU(inplace=True)\n",
      "  (7): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (8): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      ")\n",
      "base_model.body.block11.rep.0 ReLU()\n",
      "base_model.body.block11.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block11.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block11.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block11.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block11.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block11.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block11.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block11.rep.4.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block11.rep.5 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block11.rep.6 ReLU(inplace=True)\n",
      "base_model.body.block11.rep.7 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block11.rep.7.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block11.rep.7.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block11.rep.8 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block12 Block(\n",
      "  (skip): Conv2d(728, 1024, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "  (skipbn): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (rep): Sequential(\n",
      "    (0): ReLU()\n",
      "    (1): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (3): ReLU(inplace=True)\n",
      "    (4): SeparableConv2d(\n",
      "      (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "      (pointwise): Conv2d(728, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "    )\n",
      "    (5): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "    (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "  )\n",
      ")\n",
      "base_model.body.block12.skip Conv2d(728, 1024, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
      "base_model.body.block12.skipbn BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block12.rep Sequential(\n",
      "  (0): ReLU()\n",
      "  (1): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (2): BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (3): ReLU(inplace=True)\n",
      "  (4): SeparableConv2d(\n",
      "    (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "    (pointwise): Conv2d(728, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "  )\n",
      "  (5): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "  (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      ")\n",
      "base_model.body.block12.rep.0 ReLU()\n",
      "base_model.body.block12.rep.1 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block12.rep.1.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block12.rep.1.pointwise Conv2d(728, 728, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block12.rep.2 BatchNorm2d(728, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block12.rep.3 ReLU(inplace=True)\n",
      "base_model.body.block12.rep.4 SeparableConv2d(\n",
      "  (conv1): Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "  (pointwise): Conv2d(728, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.block12.rep.4.conv1 Conv2d(728, 728, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=728, bias=False)\n",
      "base_model.body.block12.rep.4.pointwise Conv2d(728, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.block12.rep.5 BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.block12.rep.6 MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
      "base_model.body.conv3 SeparableConv2d(\n",
      "  (conv1): Conv2d(1024, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1024, bias=False)\n",
      "  (pointwise): Conv2d(1024, 1536, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.conv3.conv1 Conv2d(1024, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1024, bias=False)\n",
      "base_model.body.conv3.pointwise Conv2d(1024, 1536, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.bn3 BatchNorm2d(1536, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.act3 ReLU(inplace=True)\n",
      "base_model.body.conv4 SeparableConv2d(\n",
      "  (conv1): Conv2d(1536, 1536, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1536, bias=False)\n",
      "  (pointwise): Conv2d(1536, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      ")\n",
      "base_model.body.conv4.conv1 Conv2d(1536, 1536, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=1536, bias=False)\n",
      "base_model.body.conv4.pointwise Conv2d(1536, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)\n",
      "base_model.body.bn4 BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
      "base_model.body.act4 ReLU(inplace=True)\n",
      "base_model.body.global_pool SelectAdaptivePool2d(pool_type=avg, flatten=Flatten(start_dim=1, end_dim=-1))\n",
      "base_model.body.global_pool.pool AdaptiveAvgPool2d(output_size=1)\n",
      "base_model.body.global_pool.flatten Flatten(start_dim=1, end_dim=-1)\n",
      "base_model.body.fc Identity()\n",
      "custom_head Sequential(\n",
      "  (0): AdaptiveAvgPool2d(output_size=1)\n",
      "  (1): Flatten(start_dim=1, end_dim=-1)\n",
      "  (2): Linear(in_features=728, out_features=368, bias=True)\n",
      "  (3): ReLU()\n",
      "  (4): Linear(in_features=368, out_features=3, bias=True)\n",
      "  (5): Sigmoid()\n",
      ")\n",
      "custom_head.0 AdaptiveAvgPool2d(output_size=1)\n",
      "custom_head.1 Flatten(start_dim=1, end_dim=-1)\n",
      "custom_head.2 Linear(in_features=728, out_features=368, bias=True)\n",
      "custom_head.3 ReLU()\n",
      "custom_head.4 Linear(in_features=368, out_features=3, bias=True)\n",
      "custom_head.5 Sigmoid()\n"
     ]
    }
   ],
   "source": [
    "for c in model.named_modules():\n",
    "    print(c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Conv2d(1536, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.base_model.body.conv4.pointwise"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[(array([0, 2, 3, 4, 5, 6]), array([1, 7])), (array([0, 1, 2, 4, 5, 7]), array([3, 6])), (array([0, 1, 3, 4, 6, 7]), array([2, 5])), (array([0, 1, 2, 3, 5, 6, 7]), array([4])), (array([1, 2, 3, 4, 5, 6, 7]), array([0]))]\n",
      "0 [0 2 3 4 5 6] [1 7]\n",
      "1 [0 1 3 4 6 7] [2 5]\n",
      "2 [1 2 4 5 6 7] [0 3]\n",
      "3 [0 1 2 3 5 6 7] [4]\n",
      "4 [0 1 2 3 4 5 7] [6]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import KFold\n",
    "\n",
    "k = KFold(n_splits = 5, shuffle = True)\n",
    "a = [1, 2, 3, 4 ,5, 6,7, 8]\n",
    "\n",
    "for d, (b, c) in enumerate(k.split(a)):\n",
    "    print(d, b, c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from torch.utils.data import Subset, DataLoader, Dataset\n",
    "\n",
    "class ListDataset(Dataset):\n",
    "    def __init__(self, data_list, labels_list, status):\n",
    "        self.data = data_list\n",
    "        self.labels = labels_list\n",
    "        self.status = status\n",
    "\n",
    "    def __len__(self):\n",
    "        return len(self.data)\n",
    "\n",
    "    def __getitem__(self, idx):\n",
    "        sample = self.data[idx]  \n",
    "\n",
    "        if self.status:\n",
    "            from Image_Process.Image_Generator import Image_generator\n",
    "            ImageGenerator = Image_generator(\"\", \"\", 12)\n",
    "            Transform = ImageGenerator.Generator_Content(5)\n",
    "            sample = Transform(sample)\n",
    "\n",
    "        label = self.labels[idx]\n",
    "        return sample, label\n",
    "\n",
    "k = KFold(n_splits = 5, shuffle = True)\n",
    "a = [1, 2, 3, 4 ,5, 6,7, 8]\n",
    "label = [10, 20, 30, 40, 50,60, 70, 80]\n",
    "\n",
    "f = ListDataset(a, label, True)\n",
    "\n",
    "for d, (b, c) in enumerate(k.split(a)):\n",
    "    # Create training and validation subsets for this fold\n",
    "    train_subset = torch.utils.data.Subset(training_dataset, train_idx)\n",
    "    val_subset = torch.utils.data.Subset(training_dataset, val_idx)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Gaussian Kernel:\n",
      " [[0.00134197 0.00407653 0.00794    0.00991586 0.00794    0.00407653\n",
      "  0.00134197]\n",
      " [0.00407653 0.01238341 0.02411958 0.03012171 0.02411958 0.01238341\n",
      "  0.00407653]\n",
      " [0.00794    0.02411958 0.04697853 0.05866909 0.04697853 0.02411958\n",
      "  0.00794   ]\n",
      " [0.00991586 0.03012171 0.05866909 0.07326883 0.05866909 0.03012171\n",
      "  0.00991586]\n",
      " [0.00794    0.02411958 0.04697853 0.05866909 0.04697853 0.02411958\n",
      "  0.00794   ]\n",
      " [0.00407653 0.01238341 0.02411958 0.03012171 0.02411958 0.01238341\n",
      "  0.00407653]\n",
      " [0.00134197 0.00407653 0.00794    0.00991586 0.00794    0.00407653\n",
      "  0.00134197]]\n",
      "Sum of kernel: 1.0\n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[([0, 1, 2, 3], [0, 0, 1]), ([4, 5, 6, 7], [0, 0, 1])]\n",
      "[]\n"
     ]
    }
   ],
   "source": [
    "a = [[0, 1, 2, 3], [4, 5, 6, 7]]\n",
    "b = [[0, 0, 1], [0, 0, 1]]\n",
    "\n",
    "c = zip(a, b)\n",
    "print(list(c))\n",
    "\n",
    "print(list(zip(zip(*c))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.4\n",
      "0.4\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "from sklearn.metrics import accuracy_score\n",
    "\n",
    "a = np.array([0 ,1, 1, 0, 0])\n",
    "b = np.array([1, 0, 1, 1, 0])\n",
    "\n",
    "print((a == b).mean())\n",
    "print(accuracy_score(a, b))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor([[[[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]]],\n",
      "\n",
      "\n",
      "        [[[0.0157, 0.0196, 0.0196,  ..., 0.0235, 0.0196, 0.0196],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0157, 0.0157, 0.0196],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0157, 0.0196, 0.0235],\n",
      "          ...,\n",
      "          [0.0196, 0.0235, 0.0196,  ..., 0.0196, 0.0196, 0.0196],\n",
      "          [0.0196, 0.0196, 0.0157,  ..., 0.0196, 0.0196, 0.0235],\n",
      "          [0.0196, 0.0196, 0.0157,  ..., 0.0157, 0.0196, 0.0196]],\n",
      "\n",
      "         [[0.0196, 0.0196, 0.0196,  ..., 0.0196, 0.0157, 0.0196],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0196],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0157, 0.0157, 0.0157],\n",
      "          ...,\n",
      "          [0.0157, 0.0157, 0.0157,  ..., 0.0157, 0.0157, 0.0196],\n",
      "          [0.0157, 0.0157, 0.0157,  ..., 0.0157, 0.0157, 0.0196],\n",
      "          [0.0196, 0.0157, 0.0157,  ..., 0.0157, 0.0157, 0.0157]],\n",
      "\n",
      "         [[0.0196, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0196],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0196],\n",
      "          [0.0196, 0.0196, 0.0157,  ..., 0.0196, 0.0235, 0.0196],\n",
      "          ...,\n",
      "          [0.0196, 0.0196, 0.0235,  ..., 0.0196, 0.0196, 0.0196],\n",
      "          [0.0196, 0.0157, 0.0196,  ..., 0.0157, 0.0196, 0.0196],\n",
      "          [0.0235, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0196]]],\n",
      "\n",
      "\n",
      "        [[[0.0196, 0.0196, 0.0196,  ..., 0.0196, 0.0235, 0.0157],\n",
      "          [0.0235, 0.0196, 0.0196,  ..., 0.0196, 0.0235, 0.0157],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          ...,\n",
      "          [0.0235, 0.0157, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          [0.0196, 0.0157, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          [0.0118, 0.0118, 0.0118,  ..., 0.0118, 0.0118, 0.0078]],\n",
      "\n",
      "         [[0.0157, 0.0196, 0.0196,  ..., 0.0196, 0.0235, 0.0157],\n",
      "          [0.0157, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0157, 0.0196, 0.0157],\n",
      "          ...,\n",
      "          [0.0157, 0.0196, 0.0157,  ..., 0.0157, 0.0196, 0.0157],\n",
      "          [0.0157, 0.0157, 0.0196,  ..., 0.0196, 0.0196, 0.0118],\n",
      "          [0.0118, 0.0078, 0.0118,  ..., 0.0118, 0.0118, 0.0118]],\n",
      "\n",
      "         [[0.0118, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          [0.0196, 0.0196, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          [0.0157, 0.0196, 0.0157,  ..., 0.0196, 0.0235, 0.0157],\n",
      "          ...,\n",
      "          [0.0196, 0.0157, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          [0.0196, 0.0157, 0.0196,  ..., 0.0196, 0.0196, 0.0157],\n",
      "          [0.0118, 0.0118, 0.0118,  ..., 0.0118, 0.0118, 0.0118]]],\n",
      "\n",
      "\n",
      "        ...,\n",
      "\n",
      "\n",
      "        [[[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]]],\n",
      "\n",
      "\n",
      "        [[[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]]],\n",
      "\n",
      "\n",
      "        [[[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]],\n",
      "\n",
      "         [[0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          ...,\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000],\n",
      "          [0.0000, 0.0000, 0.0000,  ..., 0.0000, 0.0000, 0.0000]]]])\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[ WARN:0@13914.976] global loadsave.cpp:268 findDecoder imread_('a'): can't open/read file: check file path/integrity\n"
     ]
    },
    {
     "ename": "ValueError",
     "evalue": "pic should be 2/3 dimensional. Got 0 dimensions.",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[2], line 22\u001b[0m\n\u001b[1;32m     20\u001b[0m Dataset \u001b[38;5;241m=\u001b[39m Train\u001b[38;5;241m.\u001b[39mSetting_DataSet(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m../Dataset/Training/stomach_cancer_Crop/\u001b[39m\u001b[38;5;124m\"\u001b[39m, [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m], \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTraining\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m     21\u001b[0m Data \u001b[38;5;241m=\u001b[39m DataLoader(dataset \u001b[38;5;241m=\u001b[39m Dataset, batch_size \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m64\u001b[39m, shuffle\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, num_workers \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m, pin_memory\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[0;32m---> 22\u001b[0m \u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mimages\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlabels\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mData\u001b[49m\u001b[43m:\u001b[49m\n\u001b[1;32m     23\u001b[0m \u001b[43m    \u001b[49m\u001b[38;5;28;43mprint\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mimages\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     24\u001b[0m \u001b[43m    \u001b[49m\u001b[38;5;28;43;01mbreak\u001b[39;49;00m\n",
      "File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/torch/utils/data/dataloader.py:708\u001b[0m, in \u001b[0;36m_BaseDataLoaderIter.__next__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    705\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sampler_iter \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m    706\u001b[0m     \u001b[38;5;66;03m# TODO(https://github.com/pytorch/pytorch/issues/76750)\u001b[39;00m\n\u001b[1;32m    707\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_reset()  \u001b[38;5;66;03m# type: ignore[call-arg]\u001b[39;00m\n\u001b[0;32m--> 708\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_next_data\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    709\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_num_yielded \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[1;32m    710\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m    711\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_dataset_kind \u001b[38;5;241m==\u001b[39m _DatasetKind\u001b[38;5;241m.\u001b[39mIterable\n\u001b[1;32m    712\u001b[0m     \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_IterableDataset_len_called \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m    713\u001b[0m     \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_num_yielded \u001b[38;5;241m>\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_IterableDataset_len_called\n\u001b[1;32m    714\u001b[0m ):\n",
      "File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/torch/utils/data/dataloader.py:764\u001b[0m, in \u001b[0;36m_SingleProcessDataLoaderIter._next_data\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    762\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21m_next_data\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m    763\u001b[0m     index \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_index()  \u001b[38;5;66;03m# may raise StopIteration\u001b[39;00m\n\u001b[0;32m--> 764\u001b[0m     data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_dataset_fetcher\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfetch\u001b[49m\u001b[43m(\u001b[49m\u001b[43mindex\u001b[49m\u001b[43m)\u001b[49m  \u001b[38;5;66;03m# may raise StopIteration\u001b[39;00m\n\u001b[1;32m    765\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_pin_memory:\n\u001b[1;32m    766\u001b[0m         data \u001b[38;5;241m=\u001b[39m _utils\u001b[38;5;241m.\u001b[39mpin_memory\u001b[38;5;241m.\u001b[39mpin_memory(data, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_pin_memory_device)\n",
      "File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/torch/utils/data/_utils/fetch.py:52\u001b[0m, in \u001b[0;36m_MapDatasetFetcher.fetch\u001b[0;34m(self, possibly_batched_index)\u001b[0m\n\u001b[1;32m     50\u001b[0m         data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdataset\u001b[38;5;241m.\u001b[39m__getitems__(possibly_batched_index)\n\u001b[1;32m     51\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 52\u001b[0m         data \u001b[38;5;241m=\u001b[39m \u001b[43m[\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdataset\u001b[49m\u001b[43m[\u001b[49m\u001b[43midx\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mpossibly_batched_index\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m     53\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m     54\u001b[0m     data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdataset[possibly_batched_index]\n",
      "File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/torch/utils/data/_utils/fetch.py:52\u001b[0m, in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m     50\u001b[0m         data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdataset\u001b[38;5;241m.\u001b[39m__getitems__(possibly_batched_index)\n\u001b[1;32m     51\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 52\u001b[0m         data \u001b[38;5;241m=\u001b[39m [\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdataset\u001b[49m\u001b[43m[\u001b[49m\u001b[43midx\u001b[49m\u001b[43m]\u001b[49m \u001b[38;5;28;01mfor\u001b[39;00m idx \u001b[38;5;129;01min\u001b[39;00m possibly_batched_index]\n\u001b[1;32m     53\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m     54\u001b[0m     data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdataset[possibly_batched_index]\n",
      "File \u001b[0;32m/workspace/Stomach_Cancer/Program_Pytorch_New/Training_Tools/PreProcess.py:26\u001b[0m, in \u001b[0;36mListDataset.__getitem__\u001b[0;34m(self, idx)\u001b[0m\n\u001b[1;32m     23\u001b[0m     \u001b[38;5;28mprint\u001b[39m(e)\n\u001b[1;32m     25\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtransform \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m---> 26\u001b[0m     Image \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtransform\u001b[49m\u001b[43m(\u001b[49m\u001b[43mImage\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     27\u001b[0m     \u001b[38;5;66;03m# print(\"Transform is running!!\\n\")\u001b[39;00m\n\u001b[1;32m     28\u001b[0m \u001b[38;5;66;03m# print(f\"Data transform is : {sample}\\n\")\u001b[39;00m\n\u001b[1;32m     30\u001b[0m label \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlabels[idx]\n",
      "File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/torchvision/transforms/transforms.py:95\u001b[0m, in \u001b[0;36mCompose.__call__\u001b[0;34m(self, img)\u001b[0m\n\u001b[1;32m     93\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21m__call__\u001b[39m(\u001b[38;5;28mself\u001b[39m, img):\n\u001b[1;32m     94\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m t \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtransforms:\n\u001b[0;32m---> 95\u001b[0m         img \u001b[38;5;241m=\u001b[39m \u001b[43mt\u001b[49m\u001b[43m(\u001b[49m\u001b[43mimg\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     96\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m img\n",
      "File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/torchvision/transforms/transforms.py:137\u001b[0m, in \u001b[0;36mToTensor.__call__\u001b[0;34m(self, pic)\u001b[0m\n\u001b[1;32m    129\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21m__call__\u001b[39m(\u001b[38;5;28mself\u001b[39m, pic):\n\u001b[1;32m    130\u001b[0m \u001b[38;5;250m    \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m    131\u001b[0m \u001b[38;5;124;03m    Args:\u001b[39;00m\n\u001b[1;32m    132\u001b[0m \u001b[38;5;124;03m        pic (PIL Image or numpy.ndarray): Image to be converted to tensor.\u001b[39;00m\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m    135\u001b[0m \u001b[38;5;124;03m        Tensor: Converted image.\u001b[39;00m\n\u001b[1;32m    136\u001b[0m \u001b[38;5;124;03m    \"\"\"\u001b[39;00m\n\u001b[0;32m--> 137\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mF\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mto_tensor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpic\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/torchvision/transforms/functional.py:145\u001b[0m, in \u001b[0;36mto_tensor\u001b[0;34m(pic)\u001b[0m\n\u001b[1;32m    142\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpic should be PIL Image or ndarray. Got \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mtype\u001b[39m(pic)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m    144\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m _is_numpy(pic) \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m _is_numpy_image(pic):\n\u001b[0;32m--> 145\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpic should be 2/3 dimensional. Got \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mpic\u001b[38;5;241m.\u001b[39mndim\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m dimensions.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m    147\u001b[0m default_float_dtype \u001b[38;5;241m=\u001b[39m torch\u001b[38;5;241m.\u001b[39mget_default_dtype()\n\u001b[1;32m    149\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(pic, np\u001b[38;5;241m.\u001b[39mndarray):\n\u001b[1;32m    150\u001b[0m     \u001b[38;5;66;03m# handle numpy array\u001b[39;00m\n",
      "\u001b[0;31mValueError\u001b[0m: pic should be 2/3 dimensional. Got 0 dimensions."
     ]
    }
   ],
   "source": [
    "from torch.utils.data import DataLoader\n",
    "from torchvision.datasets import ImageFolder\n",
    "from torchvision import transforms\n",
    "from Training_Tools.PreProcess import Training_Precesses\n",
    "\n",
    "# Define a transform (e.g., resize and convert to tensor)\n",
    "transform = transforms.Compose([\n",
    "    transforms.Resize((224, 224)),  # Example size\n",
    "    transforms.ToTensor()\n",
    "])\n",
    "\n",
    "image_folder = ImageFolder(\"../Dataset/Training\", transform = transform)\n",
    "Data = DataLoader(dataset = image_folder, batch_size = 64, shuffle=True, num_workers = 0, pin_memory=True)\n",
    "\n",
    "for images, labels in Data:\n",
    "    print(images)\n",
    "    break\n",
    "\n",
    "Train = Training_Precesses(224)\n",
    "Dataset = Train.Setting_DataSet(\"../Dataset/Training/stomach_cancer_Crop/\", [1, 0, 0], \"Training\")\n",
    "Data = DataLoader(dataset = Dataset, batch_size = 64, shuffle=True, num_workers = 0, pin_memory=True)\n",
    "for images, labels in Data:\n",
    "    print(images)\n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 188664 characters]",
      "image/png": "[encoded data, 2264964 characters]",
      "text/plain": [
       "<PIL.Image.Image image mode=RGB size=1229x1039>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from PIL import Image\n",
    "import numpy as np\n",
    "import cv2\n",
    "\n",
    "# image = cv2.imread('../Dataset/Training/stomach_cancer_Crop/C15_2.jpg', cv2.IMREAD_COLOR) # 讀檔(彩色)\n",
    "\n",
    "image = Image.open('../Dataset/Training/stomach_cancer_Crop/A01.jpg').convert(\"RGB\")\n",
    "\n",
    "Image._show(image)\n",
    "# # image = image.resize( (256, 256) ) #指定長與寬並進行縮圖製作\n",
    "# image = np.array(image)\n",
    "# # image = image.reshape(-1, 256, 256, 3)  # 更改陣列形狀\n",
    "# image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[[0.0005, 0.0006, 0.0008,  ..., 0.0005, 0.0006, 0.0009],\n",
       "         [0.0004, 0.0006, 0.0008,  ..., 0.0004, 0.0007, 0.0008],\n",
       "         [0.0003, 0.0007, 0.0006,  ..., 0.0003, 0.0007, 0.0005],\n",
       "         ...,\n",
       "         [0.0003, 0.0008, 0.0006,  ..., 0.0003, 0.0008, 0.0006],\n",
       "         [0.0003, 0.0004, 0.0005,  ..., 0.0004, 0.0004, 0.0006],\n",
       "         [0.0002, 0.0004, 0.0004,  ..., 0.0002, 0.0003, 0.0005]],\n",
       "\n",
       "        [[0.0005, 0.0009, 0.0008,  ..., 0.0004, 0.0009, 0.0008],\n",
       "         [0.0007, 0.0006, 0.0006,  ..., 0.0006, 0.0006, 0.0006],\n",
       "         [0.0006, 0.0003, 0.0003,  ..., 0.0006, 0.0002, 0.0003],\n",
       "         ...,\n",
       "         [0.0006, 0.0003, 0.0003,  ..., 0.0006, 0.0002, 0.0003],\n",
       "         [0.0005, 0.0003, 0.0006,  ..., 0.0006, 0.0003, 0.0007],\n",
       "         [0.0003, 0.0004, 0.0006,  ..., 0.0003, 0.0004, 0.0006]],\n",
       "\n",
       "        [[0.0006, 0.0004, 0.0006,  ..., 0.0005, 0.0004, 0.0006],\n",
       "         [0.0006, 0.0005, 0.0006,  ..., 0.0005, 0.0005, 0.0005],\n",
       "         [0.0004, 0.0004, 0.0004,  ..., 0.0004, 0.0004, 0.0003],\n",
       "         ...,\n",
       "         [0.0004, 0.0004, 0.0004,  ..., 0.0004, 0.0004, 0.0003],\n",
       "         [0.0005, 0.0007, 0.0005,  ..., 0.0005, 0.0006, 0.0005],\n",
       "         [0.0004, 0.0004, 0.0005,  ..., 0.0004, 0.0004, 0.0006]]])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from Image_Process.Image_Generator import Image_generator\n",
    "Image_Generator_Content = Image_generator(\"\", \"\", 256)\n",
    "Transform = Image_Generator_Content.Generator_Content(5)\n",
    "\n",
    "image = Transform(image)\n",
    "image"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'ListDataset' object has no attribute 'shape'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[15], line 6\u001b[0m\n\u001b[1;32m      3\u001b[0m PreProcess \u001b[38;5;241m=\u001b[39m Training_Precesses(\u001b[38;5;241m256\u001b[39m)\n\u001b[1;32m      4\u001b[0m Testing_Dataset \u001b[38;5;241m=\u001b[39m PreProcess\u001b[38;5;241m.\u001b[39mSetting_DataSet(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m../Dataset/Training/stomach_cancer_Crop/A01.jpg\u001b[39m\u001b[38;5;124m\"\u001b[39m, [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m], \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTraining\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m----> 6\u001b[0m \u001b[43mTesting_Dataset\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\n",
      "\u001b[0;31mAttributeError\u001b[0m: 'ListDataset' object has no attribute 'shape'"
     ]
    }
   ],
   "source": [
    "from Training_Tools.PreProcess import Training_Precesses\n",
    "\n",
    "PreProcess = Training_Precesses(256)\n",
    "Testing_Dataset = PreProcess.Setting_DataSet(\"../Dataset/Training/stomach_cancer_Crop/A01.jpg\", [1, 0, 0], \"Training\")\n",
    "\n",
    "Testing_Dataset.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 188664 characters]",
      "image/png": "[encoded data, 2264964 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1229x1039>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "path = \"../Dataset/Training/stomach_cancer_Crop/A01.jpg\"\n",
    "\n",
    "with open(path, \"rb\") as f:\n",
    "    image = Image.open(f)\n",
    "    image.convert(\"RGB\")\n",
    "\n",
    "    Image._show(image)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['123456789', '123456789', '123456789']"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = \"123456789\"\n",
    "\n",
    "b = [a for i in range(3)]\n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stomach_cancer_Crop 有 68 筆資料 \n",
      "Normal_Crop 有 36 筆資料 \n",
      "Have_Question_Crop 有 26 筆資料 \n",
      "\n",
      "test_labels有130筆資料\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from draw_tools.Grad_cam import GradCAM\n",
    "from Load_process.Load_Indepentend import Load_Indepentend_Data\n",
    "from Training_Tools.Tools import Tool\n",
    "from experiments.pytorch_Model import ModifiedXception\n",
    "from Training_Tools.PreProcess import Training_Precesses\n",
    "import torch\n",
    "import json\n",
    "import torch.nn as nn\n",
    "\n",
    "model_path = \"../Result/save_the_best_model/Xception Skin trains Stomach Cancer Dataset, and uses WeightRandomSampler apply sharpen/Xception/best_model( 2025-05-13 )-_fold0.pt\"\n",
    "device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n",
    "\n",
    "with open('utils/Stomach_Config.json') as f:\n",
    "    config = json.load(f)\n",
    "Training_Configs = config['Training_Config']\n",
    "Loading_Config = config['Loading_Config']\n",
    "\n",
    "tool = Tool()\n",
    "\n",
    "tool.Set_OneHotEncording(Loading_Config[\"Training_Labels\"])\n",
    "Encording_Label = tool.Get_OneHot_Encording_Label()\n",
    "\n",
    "cut_image = Load_Indepentend_Data(Loading_Config[\"Training_Labels\"], Encording_Label)\n",
    "\n",
    "Model = ModifiedXception(3)\n",
    "\n",
    "if torch.cuda.device_count() > 1:\n",
    "    Model = nn.DataParallel(Model)\n",
    "\n",
    "Model = Model.to(device)\n",
    "TargetLayer = Model.base_model.conv4.pointwise\n",
    "\n",
    "Model.load_state_dict(torch.load(model_path))\n",
    "\n",
    "# 预处理对象\n",
    "preprocess = Training_Precesses(256)\n",
    "\n",
    "cut_image.process_main(Loading_Config[\"Test_Data_Root\"]) # 呼叫處理test Data與Validation Data的function\n",
    "test, test_label = cut_image.test, cut_image.test_label\n",
    "\n",
    "# 只评估目标类别\n",
    "# 转换为PyTorch张量并移动到设备\n",
    "test_dataset = preprocess.Setting_DataSet(cut_image.test, cut_image.test_label, \"Transform\")\n",
    "test_loader = preprocess.Dataloader_Sampler(test_dataset, 1, False)\n",
    "\n",
    "Grad = GradCAM(Model, TargetLayer)\n",
    "Grad.Processing_Main(test_loader, f\"123456\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "f1\n"
     ]
    }
   ],
   "source": [
    "def f1():\n",
    "    return 1\n",
    "\n",
    "import json\n",
    "with open('utils/Stomach_Config.json') as f:\n",
    "        config = json.load(f)\n",
    "\n",
    "a = config[\"a\"]\n",
    "\n",
    "print(a[\"Function\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([1, 1000])\n"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "\n",
    "class SeparableConv2d(nn.Module):\n",
    "    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, bias=True):\n",
    "        super(SeparableConv2d, self).__init__()\n",
    "        self.depthwise = nn.Conv2d(in_channels, in_channels, kernel_size=kernel_size, stride=stride,\n",
    "                                 padding=padding, groups=in_channels, bias=bias)\n",
    "        self.pointwise = nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=1,\n",
    "                                 padding=0, bias=bias)\n",
    "    \n",
    "    def forward(self, x):\n",
    "        x = self.depthwise(x)\n",
    "        x = self.pointwise(x)\n",
    "        return x\n",
    "\n",
    "class EntryFlow(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(EntryFlow, self).__init__()\n",
    "        self.conv1 = nn.Conv2d(3, 32, 3, stride=2, padding=1, bias=False)\n",
    "        self.bn1 = nn.BatchNorm2d(32)\n",
    "        self.conv2 = nn.Conv2d(32, 64, 3, padding=1, bias=False)\n",
    "        self.bn2 = nn.BatchNorm2d(64)\n",
    "        \n",
    "        self.conv3_residual = nn.Sequential(\n",
    "            SeparableConv2d(64, 128, 3, padding=1),\n",
    "            nn.BatchNorm2d(128),\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(128, 128, 3, padding=1),\n",
    "            nn.BatchNorm2d(128),\n",
    "            nn.MaxPool2d(3, stride=2, padding=1)\n",
    "        )\n",
    "        self.conv3_shortcut = nn.Conv2d(64, 128, 1, stride=2, bias=False)\n",
    "        self.bn3 = nn.BatchNorm2d(128)\n",
    "        \n",
    "        self.conv4_residual = nn.Sequential(\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(128, 256, 3, padding=1),\n",
    "            nn.BatchNorm2d(256),\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(256, 256, 3, padding=1),\n",
    "            nn.BatchNorm2d(256),\n",
    "            nn.MaxPool2d(3, stride=2, padding=1)\n",
    "        )\n",
    "        self.conv4_shortcut = nn.Conv2d(128, 256, 1, stride=2, bias=False)\n",
    "        self.bn4 = nn.BatchNorm2d(256)\n",
    "        \n",
    "        self.conv5_residual = nn.Sequential(\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(256, 728, 3, padding=1),\n",
    "            nn.BatchNorm2d(728),\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(728, 728, 3, padding=1),\n",
    "            nn.BatchNorm2d(728),\n",
    "            nn.MaxPool2d(3, stride=2, padding=1)\n",
    "        )\n",
    "        self.conv5_shortcut = nn.Conv2d(256, 728, 1, stride=2, bias=False)\n",
    "        self.bn5 = nn.BatchNorm2d(728)\n",
    "    \n",
    "    def forward(self, x):\n",
    "        x = F.relu(self.bn1(self.conv1(x)))\n",
    "        x = F.relu(self.bn2(self.conv2(x)))\n",
    "        \n",
    "        residual = self.conv3_residual(x)\n",
    "        shortcut = self.conv3_shortcut(x)\n",
    "        x = F.relu(self.bn3(residual + shortcut))\n",
    "        \n",
    "        residual = self.conv4_residual(x)\n",
    "        shortcut = self.conv4_shortcut(x)\n",
    "        x = F.relu(self.bn4(residual + shortcut))\n",
    "        \n",
    "        residual = self.conv5_residual(x)\n",
    "        shortcut = self.conv5_shortcut(x)\n",
    "        x = F.relu(self.bn5(residual + shortcut))\n",
    "        return x\n",
    "\n",
    "class MiddleFlow(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(MiddleFlow, self).__init__()\n",
    "        self.conv_residual = nn.Sequential(\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(728, 728, 3, padding=1),\n",
    "            nn.BatchNorm2d(728),\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(728, 728, 3, padding=1),\n",
    "            nn.BatchNorm2d(728),\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(728, 728, 3, padding=1),\n",
    "            nn.BatchNorm2d(728)\n",
    "        )\n",
    "    \n",
    "    def forward(self, x):\n",
    "        return self.conv_residual(x) + x\n",
    "\n",
    "class ExitFlow(nn.Module):\n",
    "    def __init__(self, num_classes=1000):\n",
    "        super(ExitFlow, self).__init__()\n",
    "        self.conv1_residual = nn.Sequential(\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(728, 1024, 3, padding=1),\n",
    "            nn.BatchNorm2d(1024),\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(1024, 1024, 3, padding=1),\n",
    "            nn.BatchNorm2d(1024),\n",
    "            nn.MaxPool2d(3, stride=2, padding=1)\n",
    "        )\n",
    "        self.conv1_shortcut = nn.Conv2d(728, 1024, 1, stride=2, bias=False)\n",
    "        self.bn1 = nn.BatchNorm2d(1024)\n",
    "        \n",
    "        self.conv2 = nn.Sequential(\n",
    "            SeparableConv2d(1024, 1536, 3, padding=1),\n",
    "            nn.BatchNorm2d(1536),\n",
    "            nn.ReLU(inplace=True),\n",
    "            SeparableConv2d(1536, 2048, 3, padding=1),\n",
    "            nn.BatchNorm2d(2048),\n",
    "            nn.ReLU(inplace=True)\n",
    "        )\n",
    "        self.avgpool = nn.AdaptiveAvgPool2d((1, 1))\n",
    "        self.fc = nn.Linear(2048, num_classes)\n",
    "    \n",
    "    def forward(self, x):\n",
    "        residual = self.conv1_residual(x)\n",
    "        shortcut = self.conv1_shortcut(x)\n",
    "        x = F.relu(self.bn1(residual + shortcut))\n",
    "        \n",
    "        x = self.conv2(x)\n",
    "        x = self.avgpool(x)\n",
    "        x = x.view(x.size(0), -1)\n",
    "        x = self.fc(x)\n",
    "        return x\n",
    "\n",
    "class Xception(nn.Module):\n",
    "    def __init__(self, num_classes=1000):\n",
    "        super(Xception, self).__init__()\n",
    "        self.entry_flow = EntryFlow()\n",
    "        self.middle_flow = nn.Sequential(*[MiddleFlow() for _ in range(8)])\n",
    "        self.exit_flow = ExitFlow(num_classes)\n",
    "    \n",
    "    def forward(self, x):\n",
    "        x = self.entry_flow(x)\n",
    "        x = self.middle_flow(x)\n",
    "        x = self.exit_flow(x)\n",
    "        return x\n",
    "\n",
    "def xception(num_classes=1000):\n",
    "    return Xception(num_classes)\n",
    "\n",
    "# Example usage:\n",
    "model = xception(num_classes=1000)\n",
    "input_tensor = torch.randn(1, 3, 299, 299)\n",
    "output = model(input_tensor)\n",
    "print(output.shape)  # Should be torch.Size([1, 1000])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "完成了0張\n",
      "完成了1張\n",
      "完成了2張\n",
      "完成了3張\n",
      "完成了4張\n",
      "完成了5張\n",
      "完成了6張\n",
      "完成了7張\n",
      "完成了8張\n",
      "完成了9張\n",
      "完成了10張\n",
      "完成了11張\n",
      "完成了12張\n",
      "完成了13張\n",
      "完成了14張\n",
      "完成了15張\n",
      "完成了16張\n",
      "完成了17張\n",
      "完成了18張\n",
      "完成了19張\n",
      "完成了20張\n",
      "完成了21張\n",
      "完成了22張\n",
      "完成了23張\n",
      "完成了24張\n",
      "完成了25張\n",
      "完成了26張\n",
      "完成了27張\n",
      "完成了28張\n",
      "完成了29張\n",
      "完成了30張\n",
      "完成了31張\n",
      "完成了32張\n",
      "完成了33張\n",
      "完成了34張\n",
      "完成了35張\n",
      "完成了36張\n",
      "完成了37張\n",
      "完成了38張\n",
      "完成了39張\n",
      "完成了40張\n",
      "完成了41張\n",
      "完成了42張\n",
      "完成了43張\n",
      "完成了44張\n",
      "完成了45張\n",
      "完成了46張\n",
      "完成了47張\n",
      "完成了48張\n",
      "完成了49張\n",
      "完成了50張\n",
      "完成了51張\n",
      "完成了52張\n",
      "完成了53張\n",
      "完成了54張\n",
      "完成了55張\n",
      "完成了56張\n",
      "完成了57張\n",
      "完成了58張\n",
      "完成了59張\n",
      "完成了60張\n",
      "完成了61張\n",
      "完成了62張\n",
      "完成了63張\n",
      "完成了64張\n",
      "完成了65張\n",
      "完成了66張\n",
      "完成了67張\n",
      "完成了68張\n",
      "完成了69張\n",
      "完成了70張\n",
      "完成了71張\n",
      "完成了72張\n",
      "完成了73張\n",
      "完成了74張\n",
      "完成了75張\n",
      "完成了76張\n",
      "完成了77張\n",
      "完成了78張\n",
      "完成了79張\n",
      "完成了80張\n",
      "完成了81張\n",
      "完成了82張\n",
      "完成了83張\n",
      "完成了84張\n",
      "完成了85張\n",
      "完成了86張\n",
      "完成了87張\n",
      "完成了88張\n",
      "完成了89張\n",
      "完成了90張\n",
      "完成了91張\n",
      "完成了92張\n",
      "完成了93張\n",
      "完成了94張\n",
      "完成了95張\n",
      "完成了96張\n",
      "完成了97張\n",
      "完成了98張\n",
      "完成了99張\n",
      "完成了100張\n",
      "完成了101張\n",
      "完成了102張\n",
      "完成了103張\n",
      "完成了104張\n",
      "完成了105張\n",
      "完成了106張\n",
      "完成了107張\n",
      "完成了108張\n",
      "完成了109張\n",
      "完成了110張\n",
      "完成了111張\n",
      "完成了112張\n",
      "完成了113張\n",
      "完成了114張\n",
      "完成了115張\n",
      "完成了116張\n",
      "完成了117張\n",
      "完成了118張\n",
      "完成了119張\n",
      "完成了120張\n",
      "完成了121張\n",
      "完成了122張\n",
      "完成了123張\n",
      "完成了124張\n",
      "完成了125張\n",
      "完成了126張\n",
      "完成了127張\n",
      "完成了128張\n",
      "完成了129張\n",
      "完成了130張\n",
      "完成了131張\n",
      "完成了132張\n",
      "完成了133張\n",
      "完成了134張\n",
      "完成了135張\n",
      "完成了136張\n",
      "完成了137張\n",
      "完成了138張\n",
      "完成了139張\n",
      "完成了140張\n",
      "完成了141張\n",
      "完成了142張\n",
      "完成了143張\n",
      "完成了144張\n",
      "完成了145張\n",
      "完成了146張\n",
      "完成了147張\n",
      "完成了148張\n",
      "完成了149張\n",
      "完成了150張\n",
      "完成了151張\n",
      "完成了152張\n",
      "完成了153張\n",
      "完成了154張\n",
      "完成了155張\n",
      "完成了156張\n",
      "完成了157張\n",
      "完成了158張\n",
      "完成了159張\n",
      "完成了160張\n",
      "完成了161張\n",
      "完成了162張\n",
      "完成了163張\n",
      "完成了164張\n",
      "完成了165張\n",
      "完成了166張\n",
      "完成了167張\n",
      "完成了168張\n",
      "完成了169張\n",
      "完成了170張\n",
      "完成了171張\n",
      "完成了172張\n",
      "完成了173張\n",
      "完成了174張\n",
      "完成了175張\n",
      "完成了176張\n",
      "完成了177張\n",
      "完成了178張\n",
      "完成了179張\n",
      "完成了180張\n",
      "完成了181張\n",
      "完成了182張\n",
      "完成了183張\n",
      "完成了184張\n",
      "完成了185張\n",
      "完成了186張\n",
      "完成了187張\n",
      "完成了188張\n",
      "完成了189張\n",
      "完成了190張\n",
      "完成了191張\n",
      "完成了192張\n",
      "完成了193張\n",
      "完成了194張\n",
      "完成了195張\n",
      "完成了196張\n",
      "完成了197張\n",
      "完成了198張\n",
      "完成了199張\n",
      "完成了200張\n",
      "完成了201張\n",
      "完成了202張\n",
      "完成了203張\n",
      "完成了204張\n",
      "完成了205張\n",
      "完成了206張\n",
      "完成了207張\n",
      "完成了208張\n",
      "完成了209張\n",
      "完成了210張\n",
      "完成了211張\n",
      "完成了212張\n",
      "完成了213張\n",
      "完成了214張\n",
      "完成了215張\n",
      "完成了216張\n",
      "完成了217張\n",
      "完成了218張\n",
      "完成了219張\n",
      "完成了220張\n",
      "完成了221張\n",
      "完成了222張\n",
      "完成了223張\n",
      "完成了224張\n",
      "完成了225張\n",
      "完成了226張\n",
      "完成了227張\n",
      "完成了228張\n",
      "完成了229張\n",
      "完成了230張\n",
      "完成了231張\n",
      "完成了232張\n",
      "完成了233張\n",
      "完成了234張\n",
      "完成了235張\n",
      "完成了236張\n",
      "完成了237張\n"
     ]
    }
   ],
   "source": [
    "import cv2\n",
    "import os\n",
    "import glob\n",
    "\n",
    "from utils.Stomach_Config import Loading_Config\n",
    "from Load_process.file_processing import Process_File\n",
    "from Load_process.LoadData import Load_Data_Tools\n",
    "\n",
    "file = Process_File()\n",
    "Load_Data_Tools = Load_Data_Tools()\n",
    "Data_Dict_Data = {\"TestingProcess_Images\" : []}\n",
    "\n",
    "path = os.path.join(\"../TestProcess_Image\", \"*\")\n",
    "path = glob.glob(path)\n",
    "Training_Data = path\n",
    "\n",
    "i = 0\n",
    "file.JudgeRoot_MakeDir(Loading_Config[\"Process_Roots\"])\n",
    "for Data in Training_Data:\n",
    "    image = cv2.imread(Data)\n",
    "    # 轉換為 HSV 色彩空間\n",
    "    image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n",
    "    # 方法1：固定閾值二值化\n",
    "    threshold_value = 100  # 閾值，可以調整\n",
    "    _, binary = cv2.threshold(image, threshold_value, 255, cv2.THRESH_BINARY)\n",
    "\n",
    "    kernel_ellipse = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (7, 7))  # 橢圓核\n",
    "    # closing_ellipse = cv2.morphologyEx(binary, cv2.MORPH_OPEN, kernel_ellipse)\n",
    "    # closing_ellipse = cv2.erode(closing_ellipse, kernel_ellipse, iterations=1)\n",
    "\n",
    "    path = file.Make_Save_Root(f\"{i}.png\", Loading_Config[\"Process_Roots\"])\n",
    "    cv2.imwrite(path, closing_ellipse)\n",
    "    print(f\"完成了{i}張\")\n",
    "    i += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import xml.etree.ElementTree as ET\n",
    "import cv2\n",
    "import os\n",
    "import numpy as np\n",
    "from typing import List, Dict, Optional, Tuple\n",
    "from utils.Stomach_Config import Loading_Config\n",
    "\n",
    "class XMLAnnotationProcessor:\n",
    "    \"\"\"\n",
    "    XML標註檔案處理器\n",
    "    專門處理包含bounding box資訊的XML檔案，並在對應圖片上繪製邊界框\n",
    "    \"\"\"\n",
    "    \n",
    "    def __init__(self, dataset_root: str = \"../Dataset/Training\"):\n",
    "        \"\"\"\n",
    "        初始化XML處理器\n",
    "        \n",
    "        Args:\n",
    "            dataset_root: 圖片資料集根目錄\n",
    "            output_folder: 輸出資料夾\n",
    "        \"\"\"\n",
    "        self.dataset_root = dataset_root\n",
    "        self.box_color = (0, 255, 0)  # 綠色邊界框\n",
    "        self.text_color = (0, 255, 0)  # 綠色文字\n",
    "        self.box_thickness = 2\n",
    "        self.font_scale = 0.5\n",
    "        self.font = cv2.FONT_HERSHEY_SIMPLEX\n",
    "    \n",
    "    def _ensure_output_folder(self, Save_Root: str) -> None:\n",
    "        \"\"\"確保輸出資料夾存在\"\"\"\n",
    "        if not os.path.exists(Save_Root):\n",
    "            os.makedirs(Save_Root)\n",
    "    \n",
    "    def parse_xml(self, xml_file_path: str, Label: str) -> Optional[Dict]:\n",
    "        \"\"\"\n",
    "        解析XML檔案並提取所有相關資訊\n",
    "        \n",
    "        Args:\n",
    "            xml_file_path: XML檔案路徑\n",
    "            \n",
    "        Returns:\n",
    "            Dict: 包含檔案資訊和bounding box的字典，解析失敗時返回None\n",
    "        \"\"\"\n",
    "        try:\n",
    "            tree = ET.parse(xml_file_path)\n",
    "            root = tree.getroot()\n",
    "            \n",
    "            # 提取基本資訊\n",
    "            filename_element = root.find('filename')\n",
    "            \n",
    "            if filename_element is None:\n",
    "                print(f\"找不到path元素在 {xml_file_path}\")\n",
    "                return None\n",
    "            \n",
    "            filename = filename_element.text if filename_element is not None else \"Unknown\"\n",
    "            Original_Image_Data_Root = os.path.join(self.dataset_root, Label)\n",
    "            Original_Image_Data_Root = os.path.join(Original_Image_Data_Root, filename)\n",
    "            \n",
    "            # 提取圖片尺寸\n",
    "            size_element = root.find('size')\n",
    "            width = int(size_element.find('width').text) if size_element is not None else 0\n",
    "            height = int(size_element.find('height').text) if size_element is not None else 0\n",
    "            depth = int(size_element.find('depth').text) if size_element is not None else 3\n",
    "            \n",
    "            # 提取所有bounding box\n",
    "            bounding_boxes = []\n",
    "            objects = root.findall('object')\n",
    "            \n",
    "            for obj in objects:\n",
    "                bndbox = obj.find('bndbox')\n",
    "                if bndbox is not None:\n",
    "                    bbox_info = {\n",
    "                        'name': obj.find('name').text if obj.find('name') is not None else \"Unknown\",\n",
    "                        'pose': obj.find('pose').text if obj.find('pose') is not None else \"Unspecified\",\n",
    "                        'truncated': int(obj.find('truncated').text) if obj.find('truncated') is not None else 0,\n",
    "                        'difficult': int(obj.find('difficult').text) if obj.find('difficult') is not None else 0,\n",
    "                        'xmin': int(bndbox.find('xmin').text),\n",
    "                        'ymin': int(bndbox.find('ymin').text),\n",
    "                        'xmax': int(bndbox.find('xmax').text),\n",
    "                        'ymax': int(bndbox.find('ymax').text)\n",
    "                    }\n",
    "                    bounding_boxes.append(bbox_info)\n",
    "            \n",
    "            return {\n",
    "                'filename': filename,\n",
    "                'image_path': Original_Image_Data_Root,\n",
    "                'width': width,\n",
    "                'height': height,\n",
    "                'depth': depth,\n",
    "                'bounding_boxes': bounding_boxes\n",
    "            }\n",
    "            \n",
    "        except Exception as e:\n",
    "            print(f\"解析XML檔案 {xml_file_path} 時發生錯誤: {str(e)}\")\n",
    "            return None\n",
    "    \n",
    "    def load_image(self, image_path: str) -> Optional[np.ndarray]:\n",
    "        \"\"\"\n",
    "        載入圖片檔案\n",
    "        \n",
    "        Args:\n",
    "            image_path: 圖片檔案路徑\n",
    "            \n",
    "        Returns:\n",
    "            np.ndarray: 圖片陣列，載入失敗時返回None\n",
    "        \"\"\"\n",
    "        if not os.path.exists(image_path):\n",
    "            print(f\"圖片檔案不存在: {image_path}\")\n",
    "            return None\n",
    "        \n",
    "        image = cv2.imread(image_path)\n",
    "        if image is None:\n",
    "            print(f\"無法讀取圖片: {image_path}\")\n",
    "            return None\n",
    "        \n",
    "        return image\n",
    "    \n",
    "    def draw_bounding_boxes(self, image: np.ndarray, bounding_boxes: List[Dict]) -> np.ndarray:\n",
    "        \"\"\"\n",
    "        創建遮罩圖片：bounding box內為白色，外部為黑色\n",
    "        \n",
    "        Args:\n",
    "            image: 圖片陣列\n",
    "            bounding_boxes: bounding box資訊列表\n",
    "            \n",
    "        Returns:\n",
    "            np.ndarray: 處理後的遮罩圖片陣列\n",
    "        \"\"\"\n",
    "        # 創建黑色背景圖片\n",
    "        height, width = image.shape[:2]\n",
    "        result_image = np.zeros((height, width, 3), dtype=np.uint8)\n",
    "        \n",
    "        for i, bbox in enumerate(bounding_boxes):\n",
    "            xmin, ymin = bbox['xmin'], bbox['ymin']\n",
    "            xmax, ymax = bbox['xmax'], bbox['ymax']\n",
    "            object_name = bbox['name']\n",
    "            \n",
    "            # 確保座標在圖片範圍內\n",
    "            xmin = max(0, min(xmin, width-1))\n",
    "            ymin = max(0, min(ymin, height-1))\n",
    "            xmax = max(0, min(xmax, width-1))\n",
    "            ymax = max(0, min(ymax, height-1))\n",
    "            \n",
    "            # 將bounding box範圍內設為白色 (255, 255, 255)\n",
    "            result_image[ymin:ymax, xmin:xmax] = [255, 255, 255]\n",
    "            \n",
    "            print(f\"Object {i+1}: {object_name} - 座標: ({xmin}, {ymin}, {xmax}, {ymax})\")\n",
    "        \n",
    "        return result_image\n",
    "    \n",
    "    def save_annotated_image(self, image: np.ndarray, original_filename: str, Label : str) -> str:\n",
    "        \"\"\"\n",
    "        儲存標註後的圖片\n",
    "        \n",
    "        Args:\n",
    "            image: 標註後的圖片陣列\n",
    "            original_filename: 原始檔案名稱\n",
    "            \n",
    "        Returns:\n",
    "            str: 儲存的檔案路徑\n",
    "        \"\"\"\n",
    "        output_filename = f\"annotated_{original_filename}\"\n",
    "        output_path = os.path.join(Loading_Config[\"Annotation_Root\"], Label)\n",
    "        Save_Image_Roots = os.path.join(output_path, output_filename)\n",
    "        # 確保輸出資料夾存在\n",
    "        self._ensure_output_folder(output_path)\n",
    "\n",
    "        cv2.imwrite(Save_Image_Roots, image)\n",
    "        print(f\"已儲存標註圖片至: {Save_Image_Roots}\")\n",
    "        return Save_Image_Roots\n",
    "    \n",
    "    def process_single_xml(self, xml_file_path: str, Label : str) -> Optional[Tuple[np.ndarray, str]]:\n",
    "        \"\"\"\n",
    "        處理單一XML檔案\n",
    "        \n",
    "        Args:\n",
    "            xml_file_path: XML檔案路徑\n",
    "            \n",
    "        Returns:\n",
    "            Tuple[np.ndarray, str]: (標註後的圖片, 輸出路徑)，處理失敗時返回None\n",
    "        \"\"\"\n",
    "        # 解析XML\n",
    "        xml_data = self.parse_xml(xml_file_path, Label)\n",
    "        if xml_data is None:\n",
    "            return None\n",
    "        \n",
    "        # 載入圖片\n",
    "        image = self.load_image(xml_data['image_path'])\n",
    "        if image is None:\n",
    "            return None\n",
    "        \n",
    "        # 繪製bounding box\n",
    "        annotated_image = self.draw_bounding_boxes(image, xml_data['bounding_boxes'])\n",
    "        \n",
    "        # 儲存結果\n",
    "        output_path = self.save_annotated_image(annotated_image, xml_data['filename'], Label)\n",
    "        \n",
    "        return annotated_image, output_path\n",
    "    \n",
    "    def process_multiple_xml(self, xml_folder_path: str, Label : str) -> List[Tuple[str, bool]]:\n",
    "        \"\"\"\n",
    "        批量處理多個XML檔案\n",
    "        \n",
    "        Args:\n",
    "            xml_folder_path: 包含XML檔案的資料夾路徑\n",
    "            \n",
    "        Returns:\n",
    "            List[Tuple[str, bool]]: [(檔案名稱, 處理成功與否), ...]\n",
    "        \"\"\"\n",
    "        if not os.path.exists(xml_folder_path):\n",
    "            print(f\"XML資料夾不存在: {xml_folder_path}\")\n",
    "            return []\n",
    "        \n",
    "        xml_files = [f for f in os.listdir(xml_folder_path) if f.endswith('.xml')]\n",
    "        \n",
    "        if not xml_files:\n",
    "            print(f\"在 {xml_folder_path} 中找不到XML檔案\")\n",
    "            return []\n",
    "        \n",
    "        print(f\"找到 {len(xml_files)} 個XML檔案\")\n",
    "        for xml_file in xml_files:            \n",
    "            try:\n",
    "                Read_XML_File = os.path.join(xml_folder_path, xml_file)\n",
    "                self.process_single_xml(Read_XML_File, Label)\n",
    "                print(f\"\\n處理檔案: {xml_file}\")\n",
    "            except Exception as e:\n",
    "                print(f\"處理 {xml_file} 時發生錯誤: {str(e)}\")\n",
    "                return\n",
    "    \n",
    "    def get_bounding_boxes_info(self, xml_file_path: str) -> Optional[Dict]:\n",
    "        \"\"\"\n",
    "        僅提取XML中的bounding box資訊，不進行圖片處理\n",
    "        \n",
    "        Args:\n",
    "            xml_file_path: XML檔案路徑\n",
    "            \n",
    "        Returns:\n",
    "            Dict: 包含檔案資訊和bounding box座標的字典\n",
    "        \"\"\"\n",
    "        return self.parse_xml(xml_file_path)\n",
    "    \n",
    "    def set_drawing_style(self, box_color: Tuple[int, int, int] = None, \n",
    "                         text_color: Tuple[int, int, int] = None,\n",
    "                         box_thickness: int = None, \n",
    "                         font_scale: float = None) -> None:\n",
    "        \"\"\"\n",
    "        設定繪圖樣式\n",
    "        \n",
    "        Args:\n",
    "            box_color: 邊界框顏色 (B, G, R)\n",
    "            text_color: 文字顏色 (B, G, R)\n",
    "            box_thickness: 邊界框粗細\n",
    "            font_scale: 字體大小\n",
    "        \"\"\"\n",
    "        if box_color is not None:\n",
    "            self.box_color = box_color\n",
    "        if text_color is not None:\n",
    "            self.text_color = text_color\n",
    "        if box_thickness is not None:\n",
    "            self.box_thickness = box_thickness\n",
    "        if font_scale is not None:\n",
    "            self.font_scale = font_scale"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "XML標註處理器已準備就绪\n",
      "找到 232 個XML檔案\n",
      "Object 1: Have_Question - 座標: (263, 740, 333, 814)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a00.jpg\n",
      "\n",
      "處理檔案: a00.xml\n",
      "Object 1: Have_Question - 座標: (406, 206, 608, 368)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1000.jpg\n",
      "\n",
      "處理檔案: A1000.xml\n",
      "Object 1: Have_Question - 座標: (740, 330, 819, 401)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1002.jpg\n",
      "\n",
      "處理檔案: A1002.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A1010.jpg\n",
      "\n",
      "處理檔案: A1010.xml\n",
      "Object 1: Have_Question - 座標: (349, 655, 474, 790)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1012.jpg\n",
      "\n",
      "處理檔案: A1012.xml\n",
      "Object 1: Have_Question - 座標: (707, 89, 1206, 746)\n",
      "Object 2: Have_Question - 座標: (100, 199, 410, 816)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1020.jpg\n",
      "\n",
      "處理檔案: A1020.xml\n",
      "Object 1: Have_Question - 座標: (720, 391, 769, 439)\n",
      "Object 2: Have_Question - 座標: (833, 621, 969, 733)\n",
      "Object 3: Have_Question - 座標: (337, 595, 735, 900)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1021.jpg\n",
      "\n",
      "處理檔案: A1021.xml\n",
      "Object 1: Have_Question - 座標: (227, 103, 518, 213)\n",
      "Object 2: Have_Question - 座標: (264, 560, 423, 667)\n",
      "Object 3: Have_Question - 座標: (423, 724, 522, 810)\n",
      "Object 4: Have_Question - 座標: (686, 652, 903, 967)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1030.jpg\n",
      "\n",
      "處理檔案: A1030.xml\n",
      "Object 1: Have_Question - 座標: (134, 266, 342, 414)\n",
      "Object 2: Have_Question - 座標: (308, 539, 486, 676)\n",
      "Object 3: Have_Question - 座標: (794, 479, 976, 669)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1031.jpg\n",
      "\n",
      "處理檔案: A1031.xml\n",
      "Object 1: Have_Question - 座標: (396, 213, 905, 977)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A10310.jpg\n",
      "\n",
      "處理檔案: A10310.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A1032.jpg\n",
      "\n",
      "處理檔案: A1032.xml\n",
      "Object 1: Have_Question - 座標: (126, 440, 190, 522)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1033.jpg\n",
      "\n",
      "處理檔案: A1033.xml\n",
      "Object 1: Have_Question - 座標: (301, 379, 484, 527)\n",
      "Object 2: Have_Question - 座標: (642, 484, 771, 615)\n",
      "Object 3: Have_Question - 座標: (642, 772, 700, 828)\n",
      "Object 4: Have_Question - 座標: (495, 836, 538, 871)\n",
      "Object 5: Have_Question - 座標: (754, 866, 858, 943)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1034.jpg\n",
      "\n",
      "處理檔案: A1034.xml\n",
      "Object 1: Have_Question - 座標: (375, 423, 629, 543)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1036.jpg\n",
      "\n",
      "處理檔案: A1036.xml\n",
      "Object 1: Have_Question - 座標: (260, 360, 782, 748)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1037.jpg\n",
      "\n",
      "處理檔案: A1037.xml\n",
      "Object 1: Have_Question - 座標: (764, 305, 901, 433)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1040.jpg\n",
      "\n",
      "處理檔案: A1040.xml\n",
      "Object 1: Have_Question - 座標: (336, 622, 681, 930)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1051.jpg\n",
      "\n",
      "處理檔案: A1051.xml\n",
      "Object 1: Have_Question - 座標: (32, 212, 441, 979)\n",
      "Object 2: Have_Question - 座標: (536, 578, 769, 777)\n",
      "Object 3: Have_Question - 座標: (981, 819, 1035, 858)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1052.jpg\n",
      "\n",
      "處理檔案: A1052.xml\n",
      "Object 1: Have_Question - 座標: (28, 379, 614, 605)\n",
      "Object 2: Have_Question - 座標: (1007, 285, 1190, 503)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1061.jpg\n",
      "\n",
      "處理檔案: A1061.xml\n",
      "Object 1: Have_Question - 座標: (399, 236, 492, 333)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1070.jpg\n",
      "\n",
      "處理檔案: A1070.xml\n",
      "Object 1: Have_Question - 座標: (395, 269, 664, 391)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1071.jpg\n",
      "\n",
      "處理檔案: A1071.xml\n",
      "Object 1: Have_Question - 座標: (207, 330, 777, 726)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1072.jpg\n",
      "\n",
      "處理檔案: A1072.xml\n",
      "Object 1: Have_Question - 座標: (160, 221, 218, 323)\n",
      "Object 2: Have_Question - 座標: (140, 567, 221, 654)\n",
      "Object 3: Have_Question - 座標: (495, 513, 663, 799)\n",
      "Object 4: Have_Question - 座標: (600, 353, 797, 477)\n",
      "Object 5: Have_Question - 座標: (735, 117, 793, 168)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1075.jpg\n",
      "\n",
      "處理檔案: A1075.xml\n",
      "Object 1: Have_Question - 座標: (590, 478, 765, 612)\n",
      "Object 2: Have_Question - 座標: (198, 607, 522, 845)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1080.jpg\n",
      "\n",
      "處理檔案: A1080.xml\n",
      "Object 1: Have_Question - 座標: (805, 545, 963, 624)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a110.jpg\n",
      "\n",
      "處理檔案: a110.xml\n",
      "Object 1: Have_Question - 座標: (427, 194, 472, 243)\n",
      "Object 2: Have_Question - 座標: (863, 42, 970, 257)\n",
      "Object 3: Have_Question - 座標: (595, 555, 791, 714)\n",
      "Object 4: Have_Question - 座標: (648, 786, 747, 875)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1100.jpg\n",
      "\n",
      "處理檔案: A1100.xml\n",
      "Object 1: Have_Question - 座標: (964, 71, 1131, 187)\n",
      "Object 2: Have_Question - 座標: (774, 600, 861, 698)\n",
      "Object 3: Have_Question - 座標: (756, 770, 849, 861)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1102.jpg\n",
      "\n",
      "處理檔案: A1102.xml\n",
      "Object 1: Have_Question - 座標: (185, 685, 394, 825)\n",
      "Object 2: Have_Question - 座標: (710, 482, 823, 550)\n",
      "Object 3: Have_Question - 座標: (872, 657, 938, 725)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1103.jpg\n",
      "\n",
      "處理檔案: A1103.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A1104.jpg\n",
      "\n",
      "處理檔案: A1104.xml\n",
      "Object 1: Have_Question - 座標: (721, 145, 1116, 581)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A1110.jpg\n",
      "\n",
      "處理檔案: A1110.xml\n",
      "Object 1: Have_Question - 座標: (737, 198, 1036, 776)\n",
      "Object 2: Have_Question - 座標: (499, 132, 608, 224)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a113.jpg\n",
      "\n",
      "處理檔案: a113.xml\n",
      "Object 1: Have_Question - 座標: (385, 258, 928, 688)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a120.jpg\n",
      "\n",
      "處理檔案: a120.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a130.jpg\n",
      "\n",
      "處理檔案: a130.xml\n",
      "Object 1: Have_Question - 座標: (297, 136, 773, 624)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a132.jpg\n",
      "\n",
      "處理檔案: a132.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a140.jpg\n",
      "\n",
      "處理檔案: a140.xml\n",
      "Object 1: Have_Question - 座標: (855, 281, 1031, 667)\n",
      "Object 2: Have_Question - 座標: (650, 664, 928, 900)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a144.jpg\n",
      "\n",
      "處理檔案: a144.xml\n",
      "Object 1: Have_Question - 座標: (480, 290, 775, 513)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a150.jpg\n",
      "\n",
      "處理檔案: a150.xml\n",
      "Object 1: Have_Question - 座標: (329, 180, 610, 435)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a172.jpg\n",
      "\n",
      "處理檔案: a172.xml\n",
      "Object 1: Have_Question - 座標: (340, 399, 553, 563)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a180.jpg\n",
      "\n",
      "處理檔案: a180.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a181.jpg\n",
      "\n",
      "處理檔案: a181.xml\n",
      "Object 1: Have_Question - 座標: (648, 280, 946, 569)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a182.jpg\n",
      "\n",
      "處理檔案: a182.xml\n",
      "Object 1: Have_Question - 座標: (314, 770, 528, 953)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a184.jpg\n",
      "\n",
      "處理檔案: a184.xml\n",
      "Object 1: Have_Question - 座標: (446, 468, 629, 640)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a190.jpg\n",
      "\n",
      "處理檔案: a190.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a200.jpg\n",
      "\n",
      "處理檔案: a200.xml\n",
      "Object 1: Have_Question - 座標: (709, 777, 861, 909)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a211.jpg\n",
      "\n",
      "處理檔案: a211.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a233.jpg\n",
      "\n",
      "處理檔案: a233.xml\n",
      "Object 1: Have_Question - 座標: (68, 108, 571, 624)\n",
      "Object 2: Have_Question - 座標: (761, 473, 916, 670)\n",
      "Object 3: Have_Question - 座標: (635, 886, 750, 978)\n",
      "Object 4: Have_Question - 座標: (897, 960, 968, 1030)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a2410.jpg\n",
      "\n",
      "處理檔案: a2410.xml\n",
      "Object 1: Have_Question - 座標: (916, 89, 1429, 411)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a249.jpg\n",
      "\n",
      "處理檔案: a249.xml\n",
      "Object 1: Have_Question - 座標: (374, 477, 442, 546)\n",
      "Object 2: Have_Question - 座標: (529, 431, 599, 505)\n",
      "Object 3: Have_Question - 座標: (726, 415, 783, 525)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a2513.jpg\n",
      "\n",
      "處理檔案: a2513.xml\n",
      "Object 1: Have_Question - 座標: (504, 416, 625, 480)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a30.jpg\n",
      "\n",
      "處理檔案: a30.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a300.jpg\n",
      "\n",
      "處理檔案: a300.xml\n",
      "Object 1: Have_Question - 座標: (764, 487, 1269, 742)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a301.jpg\n",
      "\n",
      "處理檔案: a301.xml\n",
      "Object 1: Have_Question - 座標: (516, 594, 1626, 1047)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a302.jpg\n",
      "\n",
      "處理檔案: a302.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a303.jpg\n",
      "\n",
      "處理檔案: a303.xml\n",
      "Object 1: Have_Question - 座標: (628, 394, 844, 574)\n",
      "Object 2: Have_Question - 座標: (1252, 405, 1327, 487)\n",
      "Object 3: Have_Question - 座標: (706, 625, 1272, 980)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a316.jpg\n",
      "\n",
      "處理檔案: a316.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a360.jpg\n",
      "\n",
      "處理檔案: a360.xml\n",
      "Object 1: Have_Question - 座標: (816, 122, 913, 195)\n",
      "Object 2: Have_Question - 座標: (822, 262, 1023, 549)\n",
      "Object 3: Have_Question - 座標: (881, 589, 942, 712)\n",
      "Object 4: Have_Question - 座標: (738, 778, 796, 826)\n",
      "Object 5: Have_Question - 座標: (332, 822, 637, 912)\n",
      "Object 6: Have_Question - 座標: (687, 927, 823, 981)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a3611.jpg\n",
      "\n",
      "處理檔案: a3611.xml\n",
      "Object 1: Have_Question - 座標: (962, 457, 1093, 640)\n",
      "Object 2: Have_Question - 座標: (918, 796, 1176, 1034)\n",
      "Object 3: Have_Question - 座標: (610, 935, 700, 1045)\n",
      "Object 4: Have_Question - 座標: (602, 39, 710, 188)\n",
      "Object 5: Have_Question - 座標: (385, 196, 476, 319)\n",
      "Object 6: Have_Question - 座標: (867, 50, 1104, 343)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a3612.jpg\n",
      "\n",
      "處理檔案: a3612.xml\n",
      "Object 1: Have_Question - 座標: (235, 364, 931, 912)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a3613.jpg\n",
      "\n",
      "處理檔案: a3613.xml\n",
      "Object 1: Have_Question - 座標: (373, 254, 686, 406)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a3615.jpg\n",
      "\n",
      "處理檔案: a3615.xml\n",
      "Object 1: Have_Question - 座標: (414, 246, 673, 388)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a3616.jpg\n",
      "\n",
      "處理檔案: a3616.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a364.jpg\n",
      "\n",
      "處理檔案: a364.xml\n",
      "Object 1: Have_Question - 座標: (1213, 42, 1341, 150)\n",
      "Object 2: Have_Question - 座標: (1174, 171, 1549, 382)\n",
      "Object 3: Have_Question - 座標: (1219, 379, 1566, 596)\n",
      "Object 4: Have_Question - 座標: (1086, 696, 1404, 826)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a365.jpg\n",
      "\n",
      "處理檔案: a365.xml\n",
      "Object 1: Have_Question - 座標: (1542, 266, 1654, 407)\n",
      "Object 2: Have_Question - 座標: (1151, 845, 1224, 922)\n",
      "Object 3: Have_Question - 座標: (813, 931, 952, 1011)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a367.jpg\n",
      "\n",
      "處理檔案: a367.xml\n",
      "Object 1: Have_Question - 座標: (1058, 337, 1152, 607)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a368.jpg\n",
      "\n",
      "處理檔案: a368.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a375.jpg\n",
      "\n",
      "處理檔案: a375.xml\n",
      "Object 1: Have_Question - 座標: (132, 460, 354, 685)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a4710.jpg\n",
      "\n",
      "處理檔案: a4710.xml\n",
      "Object 1: Have_Question - 座標: (90, 560, 328, 797)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a4711.jpg\n",
      "\n",
      "處理檔案: a4711.xml\n",
      "Object 1: Have_Question - 座標: (132, 355, 366, 515)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a4712.jpg\n",
      "\n",
      "處理檔案: a4712.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a473.jpg\n",
      "\n",
      "處理檔案: a473.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a474.jpg\n",
      "\n",
      "處理檔案: a474.xml\n",
      "Object 1: Have_Question - 座標: (622, 496, 696, 564)\n",
      "Object 2: Have_Question - 座標: (1053, 678, 1162, 759)\n",
      "Object 3: Have_Question - 座標: (715, 533, 1004, 761)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a4911.jpg\n",
      "\n",
      "處理檔案: a4911.xml\n",
      "Object 1: Have_Question - 座標: (517, 570, 736, 712)\n",
      "Object 2: Have_Question - 座標: (676, 723, 802, 798)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a4912.jpg\n",
      "\n",
      "處理檔案: a4912.xml\n",
      "Object 1: Have_Question - 座標: (809, 234, 1010, 421)\n",
      "Object 2: Have_Question - 座標: (383, 678, 448, 743)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a497.jpg\n",
      "\n",
      "處理檔案: a497.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a50.jpg\n",
      "\n",
      "處理檔案: a50.xml\n",
      "Object 1: Have_Question - 座標: (117, 195, 708, 978)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a509.jpg\n",
      "\n",
      "處理檔案: a509.xml\n",
      "Object 1: Have_Question - 座標: (413, 539, 567, 622)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a511.jpg\n",
      "\n",
      "處理檔案: a511.xml\n",
      "Object 1: Have_Question - 座標: (528, 121, 581, 171)\n",
      "Object 2: Have_Question - 座標: (885, 276, 964, 354)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a513.jpg\n",
      "\n",
      "處理檔案: a513.xml\n",
      "Object 1: Have_Question - 座標: (978, 458, 1151, 664)\n",
      "Object 2: Have_Question - 座標: (672, 873, 849, 1043)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a516.jpg\n",
      "\n",
      "處理檔案: a516.xml\n",
      "Object 1: Have_Question - 座標: (201, 101, 904, 499)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a520.jpg\n",
      "\n",
      "處理檔案: a520.xml\n",
      "Object 1: Have_Question - 座標: (46, 107, 746, 687)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a521.jpg\n",
      "\n",
      "處理檔案: a521.xml\n",
      "Object 1: Have_Question - 座標: (921, 779, 1014, 860)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a523.jpg\n",
      "\n",
      "處理檔案: a523.xml\n",
      "Object 1: Have_Question - 座標: (386, 101, 745, 377)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a524.jpg\n",
      "\n",
      "處理檔案: a524.xml\n",
      "Object 1: Have_Question - 座標: (89, 619, 357, 827)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a526.jpg\n",
      "\n",
      "處理檔案: a526.xml\n",
      "Object 1: Have_Question - 座標: (164, 110, 757, 294)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a5312.jpg\n",
      "\n",
      "處理檔案: a5312.xml\n",
      "Object 1: Have_Question - 座標: (62, 368, 390, 731)\n",
      "Object 2: Have_Question - 座標: (231, 276, 849, 446)\n",
      "Object 3: Have_Question - 座標: (735, 337, 1025, 907)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a5314.jpg\n",
      "\n",
      "處理檔案: a5314.xml\n",
      "Object 1: Have_Question - 座標: (260, 242, 478, 469)\n",
      "Object 2: Have_Question - 座標: (736, 448, 919, 607)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a536.jpg\n",
      "\n",
      "處理檔案: a536.xml\n",
      "Object 1: Have_Question - 座標: (163, 127, 273, 327)\n",
      "Object 2: Have_Question - 座標: (470, 230, 576, 315)\n",
      "Object 3: Have_Question - 座標: (827, 134, 925, 213)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a538.jpg\n",
      "\n",
      "處理檔案: a538.xml\n",
      "Object 1: Have_Question - 座標: (176, 401, 455, 689)\n",
      "Object 2: Have_Question - 座標: (556, 331, 632, 416)\n",
      "Object 3: Have_Question - 座標: (746, 267, 803, 340)\n",
      "Object 4: Have_Question - 座標: (567, 459, 632, 519)\n",
      "Object 5: Have_Question - 座標: (794, 391, 858, 461)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a539.jpg\n",
      "\n",
      "處理檔案: a539.xml\n",
      "Object 1: Have_Question - 座標: (400, 369, 452, 421)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a551.jpg\n",
      "\n",
      "處理檔案: a551.xml\n",
      "Object 1: Have_Question - 座標: (324, 124, 836, 389)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a5511.jpg\n",
      "\n",
      "處理檔案: a5511.xml\n",
      "Object 1: Have_Question - 座標: (46, 763, 177, 896)\n",
      "Object 2: Have_Question - 座標: (392, 662, 587, 971)\n",
      "Object 3: Have_Question - 座標: (635, 160, 1000, 972)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a560.jpg\n",
      "\n",
      "處理檔案: a560.xml\n",
      "Object 1: Have_Question - 座標: (36, 399, 435, 712)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a563.jpg\n",
      "\n",
      "處理檔案: a563.xml\n",
      "Object 1: Have_Question - 座標: (306, 617, 342, 675)\n",
      "Object 2: Have_Question - 座標: (758, 581, 824, 658)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a571.jpg\n",
      "\n",
      "處理檔案: a571.xml\n",
      "Object 1: Have_Question - 座標: (215, 288, 743, 762)\n",
      "Object 2: Have_Question - 座標: (809, 423, 931, 681)\n",
      "Object 3: Have_Question - 座標: (734, 830, 815, 972)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a590.jpg\n",
      "\n",
      "處理檔案: a590.xml\n",
      "Object 1: Have_Question - 座標: (353, 93, 788, 428)\n",
      "Object 2: Have_Question - 座標: (698, 406, 837, 641)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a591.jpg\n",
      "\n",
      "處理檔案: a591.xml\n",
      "Object 1: Have_Question - 座標: (231, 215, 659, 603)\n",
      "Object 2: Have_Question - 座標: (662, 250, 920, 770)\n",
      "Object 3: Have_Question - 座標: (425, 775, 920, 984)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a592.jpg\n",
      "\n",
      "處理檔案: a592.xml\n",
      "Object 1: Have_Question - 座標: (400, 509, 597, 800)\n",
      "Object 2: Have_Question - 座標: (492, 801, 599, 981)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a593.jpg\n",
      "\n",
      "處理檔案: a593.xml\n",
      "Object 1: Have_Question - 座標: (345, 379, 621, 684)\n",
      "Object 2: Have_Question - 座標: (630, 433, 906, 869)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a594.jpg\n",
      "\n",
      "處理檔案: a594.xml\n",
      "Object 1: Have_Question - 座標: (239, 317, 371, 431)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a60.jpg\n",
      "\n",
      "處理檔案: a60.xml\n",
      "Object 1: Have_Question - 座標: (266, 567, 609, 873)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a61.jpg\n",
      "\n",
      "處理檔案: a61.xml\n",
      "Object 1: Have_Question - 座標: (365, 69, 539, 135)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a610.jpg\n",
      "\n",
      "處理檔案: a610.xml\n",
      "Object 1: Have_Question - 座標: (175, 577, 246, 636)\n",
      "Object 2: Have_Question - 座標: (613, 54, 698, 140)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a613.jpg\n",
      "\n",
      "處理檔案: a613.xml\n",
      "Object 1: Have_Question - 座標: (439, 325, 584, 441)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a614.jpg\n",
      "\n",
      "處理檔案: a614.xml\n",
      "Object 1: Have_Question - 座標: (94, 560, 200, 675)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a616.jpg\n",
      "\n",
      "處理檔案: a616.xml\n",
      "Object 1: Have_Question - 座標: (461, 489, 674, 640)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a617.jpg\n",
      "\n",
      "處理檔案: a617.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a62.jpg\n",
      "\n",
      "處理檔案: a62.xml\n",
      "Object 1: Have_Question - 座標: (622, 190, 848, 413)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a622.jpg\n",
      "\n",
      "處理檔案: a622.xml\n",
      "Object 1: Have_Question - 座標: (608, 764, 783, 932)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a625.jpg\n",
      "\n",
      "處理檔案: a625.xml\n",
      "Object 1: Have_Question - 座標: (12, 578, 185, 823)\n",
      "Object 2: Have_Question - 座標: (186, 764, 894, 981)\n",
      "Object 3: Have_Question - 座標: (458, 287, 839, 767)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a626.jpg\n",
      "\n",
      "處理檔案: a626.xml\n",
      "Object 1: Have_Question - 座標: (52, 461, 174, 626)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a632.jpg\n",
      "\n",
      "處理檔案: a632.xml\n",
      "Object 1: Have_Question - 座標: (201, 230, 693, 507)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a64.jpg\n",
      "\n",
      "處理檔案: a64.xml\n",
      "Object 1: Have_Question - 座標: (418, 559, 534, 768)\n",
      "Object 2: Have_Question - 座標: (515, 398, 645, 455)\n",
      "Object 3: Have_Question - 座標: (354, 427, 373, 445)\n",
      "Object 4: Have_Question - 座標: (206, 599, 229, 625)\n",
      "Object 5: Have_Question - 座標: (279, 75, 369, 115)\n",
      "Object 6: Have_Question - 座標: (509, 36, 816, 200)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a641.jpg\n",
      "\n",
      "處理檔案: a641.xml\n",
      "Object 1: Have_Question - 座標: (320, 228, 489, 757)\n",
      "Object 2: Have_Question - 座標: (490, 43, 1172, 758)\n",
      "Object 3: Have_Question - 座標: (49, 387, 315, 814)\n",
      "Object 4: Have_Question - 座標: (195, 32, 319, 301)\n",
      "Object 5: Have_Question - 座標: (8, 173, 109, 362)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a6410.jpg\n",
      "\n",
      "處理檔案: a6410.xml\n",
      "Object 1: Have_Question - 座標: (37, 560, 1055, 1014)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a6411.jpg\n",
      "\n",
      "處理檔案: a6411.xml\n",
      "Object 1: Have_Question - 座標: (652, 234, 840, 469)\n",
      "Object 2: Have_Question - 座標: (1132, 525, 1159, 578)\n",
      "Object 3: Have_Question - 座標: (726, 55, 816, 101)\n",
      "Object 4: Have_Question - 座標: (505, 159, 523, 181)\n",
      "Object 5: Have_Question - 座標: (369, 393, 397, 408)\n",
      "Object 6: Have_Question - 座標: (723, 516, 891, 775)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a645.jpg\n",
      "\n",
      "處理檔案: a645.xml\n",
      "Object 1: Have_Question - 座標: (193, 271, 358, 424)\n",
      "Object 2: Have_Question - 座標: (411, 646, 524, 768)\n",
      "Object 3: Have_Question - 座標: (347, 938, 569, 1036)\n",
      "Object 4: Have_Question - 座標: (693, 640, 886, 933)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a647.jpg\n",
      "\n",
      "處理檔案: a647.xml\n",
      "Object 1: Have_Question - 座標: (837, 263, 1081, 477)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a648.jpg\n",
      "\n",
      "處理檔案: a648.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\a649.jpg\n",
      "\n",
      "處理檔案: a649.xml\n",
      "Object 1: Have_Question - 座標: (96, 176, 710, 463)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a650.jpg\n",
      "\n",
      "處理檔案: a650.xml\n",
      "Object 1: Have_Question - 座標: (278, 464, 393, 673)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a654.jpg\n",
      "\n",
      "處理檔案: a654.xml\n",
      "Object 1: Have_Question - 座標: (277, 197, 377, 266)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a655.jpg\n",
      "\n",
      "處理檔案: a655.xml\n",
      "Object 1: Have_Question - 座標: (213, 599, 427, 700)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A697.jpg\n",
      "\n",
      "處理檔案: A697.xml\n",
      "Object 1: Have_Question - 座標: (443, 260, 784, 872)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A698.jpg\n",
      "\n",
      "處理檔案: A698.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A700.jpg\n",
      "\n",
      "處理檔案: A700.xml\n",
      "Object 1: Have_Question - 座標: (464, 187, 773, 435)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A702.jpg\n",
      "\n",
      "處理檔案: A702.xml\n",
      "Object 1: Have_Question - 座標: (420, 166, 929, 363)\n",
      "Object 2: Have_Question - 座標: (479, 497, 911, 908)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A703.jpg\n",
      "\n",
      "處理檔案: A703.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A704.jpg\n",
      "\n",
      "處理檔案: A704.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A705.jpg\n",
      "\n",
      "處理檔案: A705.xml\n",
      "Object 1: Have_Question - 座標: (378, 610, 441, 716)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A706.jpg\n",
      "\n",
      "處理檔案: A706.xml\n",
      "Object 1: Have_Question - 座標: (393, 467, 480, 561)\n",
      "Object 2: Have_Question - 座標: (310, 184, 450, 351)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A707.jpg\n",
      "\n",
      "處理檔案: A707.xml\n",
      "Object 1: Have_Question - 座標: (870, 386, 987, 497)\n",
      "Object 2: Have_Question - 座標: (208, 300, 532, 533)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A710.jpg\n",
      "\n",
      "處理檔案: A710.xml\n",
      "Object 1: Have_Question - 座標: (364, 326, 427, 405)\n",
      "Object 2: Have_Question - 座標: (718, 121, 749, 179)\n",
      "Object 3: Have_Question - 座標: (496, 326, 717, 532)\n",
      "Object 4: Have_Question - 座標: (312, 408, 566, 652)\n",
      "Object 5: Have_Question - 座標: (312, 662, 569, 961)\n",
      "Object 6: Have_Question - 座標: (756, 458, 1098, 1003)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A714.jpg\n",
      "\n",
      "處理檔案: A714.xml\n",
      "Object 1: Have_Question - 座標: (626, 221, 1203, 760)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A715.jpg\n",
      "\n",
      "處理檔案: A715.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A720.jpg\n",
      "\n",
      "處理檔案: A720.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A721.jpg\n",
      "\n",
      "處理檔案: A721.xml\n",
      "Object 1: Have_Question - 座標: (338, 334, 562, 834)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A722.jpg\n",
      "\n",
      "處理檔案: A722.xml\n",
      "Object 1: Have_Question - 座標: (462, 208, 583, 318)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A730.jpg\n",
      "\n",
      "處理檔案: A730.xml\n",
      "Object 1: Have_Question - 座標: (599, 108, 760, 231)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A731.jpg\n",
      "\n",
      "處理檔案: A731.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A732.jpg\n",
      "\n",
      "處理檔案: A732.xml\n",
      "Object 1: Have_Question - 座標: (669, 257, 798, 522)\n",
      "Object 2: Have_Question - 座標: (639, 901, 737, 1041)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A734.jpg\n",
      "\n",
      "處理檔案: A734.xml\n",
      "Object 1: Have_Question - 座標: (331, 280, 1064, 742)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A750.jpg\n",
      "\n",
      "處理檔案: A750.xml\n",
      "Object 1: Have_Question - 座標: (182, 395, 891, 950)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A751.jpg\n",
      "\n",
      "處理檔案: A751.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A753.jpg\n",
      "\n",
      "處理檔案: A753.xml\n",
      "Object 1: Have_Question - 座標: (477, 252, 651, 433)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A756.jpg\n",
      "\n",
      "處理檔案: A756.xml\n",
      "Object 1: Have_Question - 座標: (543, 359, 609, 415)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A757.jpg\n",
      "\n",
      "處理檔案: A757.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A770.jpg\n",
      "\n",
      "處理檔案: A770.xml\n",
      "Object 1: Have_Question - 座標: (147, 780, 188, 837)\n",
      "Object 2: Have_Question - 座標: (431, 906, 477, 959)\n",
      "Object 3: Have_Question - 座標: (633, 739, 655, 762)\n",
      "Object 4: Have_Question - 座標: (755, 545, 784, 572)\n",
      "Object 5: Have_Question - 座標: (928, 464, 947, 486)\n",
      "Object 6: Have_Question - 座標: (575, 285, 597, 299)\n",
      "Object 7: Have_Question - 座標: (702, 278, 719, 300)\n",
      "Object 8: Have_Question - 座標: (841, 301, 872, 319)\n",
      "Object 9: Have_Question - 座標: (461, 114, 669, 180)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A771.jpg\n",
      "\n",
      "處理檔案: A771.xml\n",
      "Object 1: Have_Question - 座標: (43, 309, 68, 336)\n",
      "Object 2: Have_Question - 座標: (35, 634, 62, 667)\n",
      "Object 3: Have_Question - 座標: (830, 233, 962, 370)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A775.jpg\n",
      "\n",
      "處理檔案: A775.xml\n",
      "Object 1: Have_Question - 座標: (256, 480, 390, 812)\n",
      "Object 2: Have_Question - 座標: (82, 743, 250, 939)\n",
      "Object 3: Have_Question - 座標: (58, 103, 888, 234)\n",
      "Object 4: Have_Question - 座標: (509, 225, 1049, 480)\n",
      "Object 5: Have_Question - 座標: (781, 437, 1009, 671)\n",
      "Object 6: Have_Question - 座標: (588, 682, 801, 769)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A776.jpg\n",
      "\n",
      "處理檔案: A776.xml\n",
      "Object 1: Have_Question - 座標: (819, 136, 1004, 500)\n",
      "Object 2: Have_Question - 座標: (315, 727, 743, 939)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A777.jpg\n",
      "\n",
      "處理檔案: A777.xml\n",
      "Object 1: Have_Question - 座標: (72, 149, 265, 433)\n",
      "Object 2: Have_Question - 座標: (95, 453, 471, 816)\n",
      "Object 3: Have_Question - 座標: (429, 270, 627, 779)\n",
      "Object 4: Have_Question - 座標: (655, 97, 777, 217)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A778.jpg\n",
      "\n",
      "處理檔案: A778.xml\n",
      "Object 1: Have_Question - 座標: (233, 386, 631, 940)\n",
      "Object 2: Have_Question - 座標: (630, 391, 1123, 1027)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A780.jpg\n",
      "\n",
      "處理檔案: A780.xml\n",
      "Object 1: Have_Question - 座標: (408, 467, 545, 797)\n",
      "Object 2: Have_Question - 座標: (655, 518, 1161, 1040)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A781.jpg\n",
      "\n",
      "處理檔案: A781.xml\n",
      "Object 1: Have_Question - 座標: (331, 209, 357, 240)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A790.jpg\n",
      "\n",
      "處理檔案: A790.xml\n",
      "Object 1: Have_Question - 座標: (692, 704, 727, 733)\n",
      "Object 2: Have_Question - 座標: (819, 960, 850, 984)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A794.jpg\n",
      "\n",
      "處理檔案: A794.xml\n",
      "Object 1: Have_Question - 座標: (152, 313, 494, 767)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_a80.jpg\n",
      "\n",
      "處理檔案: a80.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A800.jpg\n",
      "\n",
      "處理檔案: A800.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A803.jpg\n",
      "\n",
      "處理檔案: A803.xml\n",
      "Object 1: Have_Question - 座標: (328, 588, 632, 825)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A806.jpg\n",
      "\n",
      "處理檔案: A806.xml\n",
      "Object 1: Have_Question - 座標: (462, 616, 649, 772)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A807.jpg\n",
      "\n",
      "處理檔案: A807.xml\n",
      "Object 1: Have_Question - 座標: (268, 114, 311, 155)\n",
      "Object 2: Have_Question - 座標: (94, 530, 248, 676)\n",
      "Object 3: Have_Question - 座標: (502, 590, 824, 733)\n",
      "Object 4: Have_Question - 座標: (502, 736, 993, 1044)\n",
      "Object 5: Have_Question - 座標: (925, 550, 1195, 900)\n",
      "Object 6: Have_Question - 座標: (496, 94, 787, 500)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A810.jpg\n",
      "\n",
      "處理檔案: A810.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A811.jpg\n",
      "\n",
      "處理檔案: A811.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A812.jpg\n",
      "\n",
      "處理檔案: A812.xml\n",
      "Object 1: Have_Question - 座標: (523, 372, 562, 409)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A820.jpg\n",
      "\n",
      "處理檔案: A820.xml\n",
      "Object 1: Have_Question - 座標: (603, 480, 761, 619)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A821.jpg\n",
      "\n",
      "處理檔案: A821.xml\n",
      "Object 1: Have_Question - 座標: (631, 364, 692, 426)\n",
      "Object 2: Have_Question - 座標: (766, 626, 829, 682)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A822.jpg\n",
      "\n",
      "處理檔案: A822.xml\n",
      "Object 1: Have_Question - 座標: (825, 313, 885, 361)\n",
      "Object 2: Have_Question - 座標: (1010, 504, 1054, 559)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A823.jpg\n",
      "\n",
      "處理檔案: A823.xml\n",
      "Object 1: Have_Question - 座標: (357, 830, 454, 908)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A824.jpg\n",
      "\n",
      "處理檔案: A824.xml\n",
      "Object 1: Have_Question - 座標: (550, 227, 593, 269)\n",
      "Object 2: Have_Question - 座標: (623, 473, 681, 533)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A825.jpg\n",
      "\n",
      "處理檔案: A825.xml\n",
      "Object 1: Have_Question - 座標: (523, 614, 610, 715)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A829.jpg\n",
      "\n",
      "處理檔案: A829.xml\n",
      "Object 1: Have_Question - 座標: (156, 153, 194, 181)\n",
      "Object 2: Have_Question - 座標: (110, 210, 137, 248)\n",
      "Object 3: Have_Question - 座標: (327, 215, 347, 252)\n",
      "Object 4: Have_Question - 座標: (523, 229, 559, 270)\n",
      "Object 5: Have_Question - 座標: (640, 336, 786, 562)\n",
      "Object 6: Have_Question - 座標: (730, 694, 754, 720)\n",
      "Object 7: Have_Question - 座標: (159, 697, 273, 817)\n",
      "Object 8: Have_Question - 座標: (57, 590, 83, 621)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A830.jpg\n",
      "\n",
      "處理檔案: A830.xml\n",
      "Object 1: Have_Question - 座標: (284, 650, 651, 910)\n",
      "Object 2: Have_Question - 座標: (579, 519, 887, 819)\n",
      "Object 3: Have_Question - 座標: (607, 286, 1010, 551)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A831.jpg\n",
      "\n",
      "處理檔案: A831.xml\n",
      "Object 1: Have_Question - 座標: (40, 102, 697, 632)\n",
      "Object 2: Have_Question - 座標: (694, 106, 1040, 389)\n",
      "Object 3: Have_Question - 座標: (796, 685, 906, 815)\n",
      "Object 4: Have_Question - 座標: (494, 763, 586, 850)\n",
      "Object 5: Have_Question - 座標: (220, 803, 330, 904)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A840.jpg\n",
      "\n",
      "處理檔案: A840.xml\n",
      "Object 1: Have_Question - 座標: (118, 97, 284, 481)\n",
      "Object 2: Have_Question - 座標: (285, 100, 701, 264)\n",
      "Object 3: Have_Question - 座標: (703, 101, 1032, 431)\n",
      "Object 4: Have_Question - 座標: (459, 421, 557, 498)\n",
      "Object 5: Have_Question - 座標: (47, 786, 390, 928)\n",
      "Object 6: Have_Question - 座標: (275, 574, 605, 811)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A841.jpg\n",
      "\n",
      "處理檔案: A841.xml\n",
      "Object 1: Have_Question - 座標: (53, 101, 656, 844)\n",
      "Object 2: Have_Question - 座標: (449, 825, 662, 940)\n",
      "Object 3: Have_Question - 座標: (657, 98, 1045, 821)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A842.jpg\n",
      "\n",
      "處理檔案: A842.xml\n",
      "Object 1: Have_Question - 座標: (21, 197, 353, 685)\n",
      "Object 2: Have_Question - 座標: (15, 687, 357, 1052)\n",
      "Object 3: Have_Question - 座標: (348, 580, 701, 1041)\n",
      "Object 4: Have_Question - 座標: (698, 689, 1043, 1044)\n",
      "Object 5: Have_Question - 座標: (835, 629, 1178, 1042)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A850.jpg\n",
      "\n",
      "處理檔案: A850.xml\n",
      "Object 1: Have_Question - 座標: (165, 259, 511, 910)\n",
      "Object 2: Have_Question - 座標: (509, 449, 1167, 948)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A851.jpg\n",
      "\n",
      "處理檔案: A851.xml\n",
      "Object 1: Have_Question - 座標: (141, 304, 1199, 954)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A852.jpg\n",
      "\n",
      "處理檔案: A852.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A853.jpg\n",
      "\n",
      "處理檔案: A853.xml\n",
      "Object 1: Have_Question - 座標: (32, 244, 440, 625)\n",
      "Object 2: Have_Question - 座標: (34, 626, 1201, 1046)\n",
      "Object 3: Have_Question - 座標: (720, 442, 1197, 627)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A854.jpg\n",
      "\n",
      "處理檔案: A854.xml\n",
      "Object 1: Have_Question - 座標: (293, 320, 610, 578)\n",
      "Object 2: Have_Question - 座標: (94, 466, 1196, 1067)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A855.jpg\n",
      "\n",
      "處理檔案: A855.xml\n",
      "Object 1: Have_Question - 座標: (389, 200, 760, 464)\n",
      "Object 2: Have_Question - 座標: (35, 35, 380, 488)\n",
      "Object 3: Have_Question - 座標: (250, 487, 600, 795)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A870.jpg\n",
      "\n",
      "處理檔案: A870.xml\n",
      "Object 1: Have_Question - 座標: (696, 34, 1192, 927)\n",
      "Object 2: Have_Question - 座標: (26, 412, 699, 752)\n",
      "Object 3: Have_Question - 座標: (25, 750, 947, 1043)\n",
      "Object 4: Have_Question - 座標: (946, 970, 1100, 1044)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A872.jpg\n",
      "\n",
      "處理檔案: A872.xml\n",
      "Object 1: Have_Question - 座標: (686, 285, 1034, 543)\n",
      "Object 2: Have_Question - 座標: (772, 535, 1041, 772)\n",
      "Object 3: Have_Question - 座標: (704, 706, 805, 841)\n",
      "Object 4: Have_Question - 座標: (441, 718, 703, 849)\n",
      "Object 5: Have_Question - 座標: (354, 544, 489, 805)\n",
      "Object 6: Have_Question - 座標: (467, 447, 701, 584)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A873.jpg\n",
      "\n",
      "處理檔案: A873.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A880.jpg\n",
      "\n",
      "處理檔案: A880.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A881.jpg\n",
      "\n",
      "處理檔案: A881.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A890.jpg\n",
      "\n",
      "處理檔案: A890.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A892.jpg\n",
      "\n",
      "處理檔案: A892.xml\n",
      "Object 1: Have_Question - 座標: (38, 43, 870, 632)\n",
      "Object 2: Have_Question - 座標: (30, 635, 287, 806)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A900.jpg\n",
      "\n",
      "處理檔案: A900.xml\n",
      "Object 1: Have_Question - 座標: (457, 29, 983, 570)\n",
      "Object 2: Have_Question - 座標: (15, 39, 492, 885)\n",
      "Object 3: Have_Question - 座標: (482, 669, 713, 950)\n",
      "Object 4: Have_Question - 座標: (982, 32, 1182, 273)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A902.jpg\n",
      "\n",
      "處理檔案: A902.xml\n",
      "Object 1: Have_Question - 座標: (174, 180, 1042, 1043)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A903.jpg\n",
      "\n",
      "處理檔案: A903.xml\n",
      "Object 1: Have_Question - 座標: (683, 414, 1044, 972)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A905.jpg\n",
      "\n",
      "處理檔案: A905.xml\n",
      "Object 1: Have_Question - 座標: (802, 278, 970, 512)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A910.jpg\n",
      "\n",
      "處理檔案: A910.xml\n",
      "Object 1: Have_Question - 座標: (484, 518, 580, 618)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A911.jpg\n",
      "\n",
      "處理檔案: A911.xml\n",
      "Object 1: Have_Question - 座標: (639, 570, 714, 642)\n",
      "Object 2: Have_Question - 座標: (1023, 381, 1087, 446)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A913.jpg\n",
      "\n",
      "處理檔案: A913.xml\n",
      "Object 1: Have_Question - 座標: (826, 142, 877, 207)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A914.jpg\n",
      "\n",
      "處理檔案: A914.xml\n",
      "Object 1: Have_Question - 座標: (446, 90, 490, 124)\n",
      "Object 2: Have_Question - 座標: (633, 98, 663, 124)\n",
      "Object 3: Have_Question - 座標: (933, 477, 993, 593)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A915.jpg\n",
      "\n",
      "處理檔案: A915.xml\n",
      "Object 1: Have_Question - 座標: (552, 31, 1102, 808)\n",
      "Object 2: Have_Question - 座標: (29, 471, 180, 921)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A916.jpg\n",
      "\n",
      "處理檔案: A916.xml\n",
      "Object 1: Have_Question - 座標: (68, 559, 451, 942)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A920.jpg\n",
      "\n",
      "處理檔案: A920.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A930.jpg\n",
      "\n",
      "處理檔案: A930.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A931.jpg\n",
      "\n",
      "處理檔案: A931.xml\n",
      "Object 1: Have_Question - 座標: (893, 545, 1174, 957)\n",
      "Object 2: Have_Question - 座標: (808, 29, 1154, 341)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A941.jpg\n",
      "\n",
      "處理檔案: A941.xml\n",
      "Object 1: Have_Question - 座標: (555, 468, 1118, 885)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A942.jpg\n",
      "\n",
      "處理檔案: A942.xml\n",
      "Object 1: Have_Question - 座標: (296, 449, 656, 750)\n",
      "Object 2: Have_Question - 座標: (1060, 243, 1107, 309)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A944.jpg\n",
      "\n",
      "處理檔案: A944.xml\n",
      "Object 1: Have_Question - 座標: (246, 396, 590, 674)\n",
      "Object 2: Have_Question - 座標: (531, 126, 749, 318)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A946.jpg\n",
      "\n",
      "處理檔案: A946.xml\n",
      "Object 1: Have_Question - 座標: (417, 363, 662, 669)\n",
      "Object 2: Have_Question - 座標: (17, 414, 49, 497)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A950.jpg\n",
      "\n",
      "處理檔案: A950.xml\n",
      "Object 1: Have_Question - 座標: (554, 597, 809, 835)\n",
      "Object 2: Have_Question - 座標: (449, 872, 543, 972)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A951.jpg\n",
      "\n",
      "處理檔案: A951.xml\n",
      "Object 1: Have_Question - 座標: (213, 98, 519, 476)\n",
      "Object 2: Have_Question - 座標: (609, 105, 850, 422)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A952.jpg\n",
      "\n",
      "處理檔案: A952.xml\n",
      "Object 1: Have_Question - 座標: (237, 413, 405, 881)\n",
      "Object 2: Have_Question - 座標: (463, 528, 776, 799)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A953.jpg\n",
      "\n",
      "處理檔案: A953.xml\n",
      "Object 1: Have_Question - 座標: (551, 798, 679, 929)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A955.jpg\n",
      "\n",
      "處理檔案: A955.xml\n",
      "Object 1: Have_Question - 座標: (180, 319, 267, 618)\n",
      "Object 2: Have_Question - 座標: (326, 233, 451, 631)\n",
      "Object 3: Have_Question - 座標: (513, 258, 598, 601)\n",
      "Object 4: Have_Question - 座標: (702, 232, 830, 511)\n",
      "Object 5: Have_Question - 座標: (371, 832, 652, 979)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A956.jpg\n",
      "\n",
      "處理檔案: A956.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A957.jpg\n",
      "\n",
      "處理檔案: A957.xml\n",
      "Object 1: Have_Question - 座標: (299, 614, 751, 939)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A960.jpg\n",
      "\n",
      "處理檔案: A960.xml\n",
      "Object 1: Have_Question - 座標: (611, 507, 1014, 818)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A961.jpg\n",
      "\n",
      "處理檔案: A961.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A9610.jpg\n",
      "\n",
      "處理檔案: A9610.xml\n",
      "Object 1: Have_Question - 座標: (66, 166, 858, 958)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A9611.jpg\n",
      "\n",
      "處理檔案: A9611.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A9612.jpg\n",
      "\n",
      "處理檔案: A9612.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A962.jpg\n",
      "\n",
      "處理檔案: A962.xml\n",
      "Object 1: Have_Question - 座標: (75, 324, 454, 914)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A963.jpg\n",
      "\n",
      "處理檔案: A963.xml\n",
      "Object 1: Have_Question - 座標: (103, 613, 704, 957)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A964.jpg\n",
      "\n",
      "處理檔案: A964.xml\n",
      "Object 1: Have_Question - 座標: (24, 363, 643, 986)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A965.jpg\n",
      "\n",
      "處理檔案: A965.xml\n",
      "Object 1: Have_Question - 座標: (28, 119, 377, 388)\n",
      "Object 2: Have_Question - 座標: (844, 849, 942, 948)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A966.jpg\n",
      "\n",
      "處理檔案: A966.xml\n",
      "Object 1: Have_Question - 座標: (7, 316, 76, 580)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A967.jpg\n",
      "\n",
      "處理檔案: A967.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A968.jpg\n",
      "\n",
      "處理檔案: A968.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A969.jpg\n",
      "\n",
      "處理檔案: A969.xml\n",
      "Object 1: Have_Question - 座標: (218, 349, 514, 609)\n",
      "Object 2: Have_Question - 座標: (574, 787, 757, 914)\n",
      "Object 3: Have_Question - 座標: (958, 768, 1191, 918)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A970.jpg\n",
      "\n",
      "處理檔案: A970.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A972.jpg\n",
      "\n",
      "處理檔案: A972.xml\n",
      "Object 1: Have_Question - 座標: (338, 449, 669, 796)\n",
      "Object 2: Have_Question - 座標: (123, 197, 359, 458)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A980.jpg\n",
      "\n",
      "處理檔案: A980.xml\n",
      "Object 1: Have_Question - 座標: (540, 125, 666, 219)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A990.jpg\n",
      "\n",
      "處理檔案: A990.xml\n",
      "圖片檔案不存在: ../Dataset/Training\\Have_Question_Crop\\A991.jpg\n",
      "\n",
      "處理檔案: A991.xml\n",
      "Object 1: Have_Question - 座標: (213, 339, 331, 459)\n",
      "已儲存標註圖片至: ../Dataset/Annotation\\Have_Question_Crop\\annotated_A994.jpg\n",
      "\n",
      "處理檔案: A994.xml\n"
     ]
    }
   ],
   "source": [
    "# 創建處理器實例\n",
    "processor = XMLAnnotationProcessor(\n",
    "    dataset_root = Loading_Config[\"Train_Data_Root\"],\n",
    ")\n",
    "\n",
    "# 設定自訂樣式（可選）\n",
    "processor.set_drawing_style(\n",
    "    box_color=(0, 0, 255),  # 紅色邊界框\n",
    "    text_color=(255, 255, 255),  # 白色文字\n",
    "    box_thickness=3,\n",
    "    font_scale=0.7\n",
    ")\n",
    "\n",
    "print(\"XML標註處理器已準備就绪\")\n",
    "results = processor.process_multiple_xml(f\"../Label_Image/Have_Question\", \"Have_Question_Crop\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Stomach_Cancer_Env",
   "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.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
