Commit 19187d3d authored by Matej Choma's avatar Matej Choma

wip finishing preparation

parent ad9e70f0
......@@ -40,7 +40,7 @@ class SRDataset(data.Dataset):
def _random_crop(self, lr, hr):
seed(int(time()))
h = hr.shape[1] - self.crop[0]
w = hr.shape[2] - self.crop[1]
......
import torch
from torch import nn
from core.base import base_conv2d, base_upsample, ResidualCatConv
from core.base import BaseModule, base_conv2d, base_upsample, ResidualCatConv
import math
class ChannelAttention(nn.Module):
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -23,6 +23,7 @@
"\n",
"from core.base import BaseModule\n",
"from core.modules import UnetBT, BaseUpsampler\n",
"from core.module_unet import UnetCascade\n",
"\n",
"import numpy as np"
]
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
......@@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
......@@ -209,7 +209,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
......@@ -227,7 +227,7 @@
" \n",
" 'range_in': (0, 1),\n",
" 'range_out': (-1, 1),\n",
" 'range_base': (0, 256)\n",
" 'range_base': (0, 255)\n",
"}\n",
"BATCH_SIZE = 16\n",
"\n",
......@@ -235,13 +235,11 @@
"logger = TensorBoardLogger('lightning_logs/', name='srresnet', default_hp_metric=False)\n",
"\n",
"# data\n",
"dataset = datasets.SRDataset(dir_hr='data/datasets/DIV2K/DIV2K_train_HR/', dir_lr='data/datasets/DIV2K/DIV2K_train_LR_mild/', crop=(128, 128))\n",
"d_train, d_val = random_split(dataset, [640, 160])\n",
"d_val_full = datasets.SRDataset(dir_hr='data/datasets/DIV2K/DIV2K_valid_HR/', dir_lr='data/datasets/DIV2K/DIV2K_valid_LR_unknown/X4/')\n",
"d_train = datasets.SRDataset(dir_hr='data/datasets/DIV2K/train_HR_480/', dir_lr='data/datasets/DIV2K/train_LR_120_unknown/', crop=(128, 128))\n",
"d_val = datasets.SRDataset(dir_hr='data/datasets/DIV2K/valid_HR_1000/', dir_lr='data/datasets/DIV2K/valid_LR_250_unknown/')\n",
"\n",
"train_loader = DataLoader(d_train, batch_size=BATCH_SIZE, num_workers=4)\n",
"val_loader = DataLoader(d_val, batch_size=BATCH_SIZE, num_workers=4)\n",
"val_full_loader = DataLoader(d_val_full, batch_size=1, num_workers=4)\n",
"val_loader = DataLoader(d_val, batch_size=4, num_workers=4)\n",
"\n",
"# model\n",
"model = SRResNet(**HPARAMS)\n",
......@@ -267,7 +265,7 @@
" \n",
" 'range_in': (0, 1),\n",
" 'range_out': (-1, 1),\n",
" 'range_base': (0, 256)\n",
" 'range_base': (0, 255)\n",
"}\n",
"BATCH_SIZE = 16\n",
"\n",
......@@ -294,7 +292,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 5,
"metadata": {},
"outputs": [
{
......@@ -307,254 +305,58 @@
"\n",
" | Name | Type | Params\n",
"---------------------------------\n",
"0 | loss | L1Loss | 0 \n",
"0 | loss | MSELoss | 0 \n",
"1 | gen | SRGen | 1.5 M \n",
"2 | disc | SRDisc | 21.8 M\n",
"3 | mse | MSELoss | 0 \n",
"---------------------------------\n",
"23.3 M Trainable params\n",
"1.5 M Trainable params\n",
"0 Non-trainable params\n",
"23.3 M Total params\n"
"1.5 M Total params\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 0: 80%|████████ | 40/50 [00:15<00:03, 2.65it/s, loss=2.09, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 0: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=2.09, v_num=10]\n",
"Epoch 1: 80%|████████ | 40/50 [00:15<00:03, 2.61it/s, loss=7.98, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 1: 100%|██████████| 50/50 [00:19<00:00, 2.53it/s, loss=7.98, v_num=10]\n",
"Epoch 2: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=2.8, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 2: 100%|██████████| 50/50 [00:19<00:00, 2.51it/s, loss=2.8, v_num=10]\n",
"Epoch 3: 80%|████████ | 40/50 [00:15<00:03, 2.61it/s, loss=7.54, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 3: 100%|██████████| 50/50 [00:19<00:00, 2.53it/s, loss=7.54, v_num=10]\n",
"Epoch 4: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=4.34, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 4: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=4.34, v_num=10]\n",
"Epoch 5: 80%|████████ | 40/50 [00:15<00:03, 2.61it/s, loss=3.7, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 5: 100%|██████████| 50/50 [00:19<00:00, 2.53it/s, loss=3.7, v_num=10]\n",
"Epoch 6: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=5, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 6: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=5, v_num=10]\n",
"Epoch 7: 80%|████████ | 40/50 [00:15<00:03, 2.61it/s, loss=3.51, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 7: 100%|██████████| 50/50 [00:19<00:00, 2.58it/s, loss=3.51, v_num=10]\n",
"Epoch 8: 80%|████████ | 40/50 [00:17<00:04, 2.30it/s, loss=2.43, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 8: 100%|██████████| 50/50 [00:21<00:00, 2.29it/s, loss=2.43, v_num=10]\n",
"Epoch 9: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=4.62, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 9: 100%|██████████| 50/50 [00:19<00:00, 2.51it/s, loss=4.62, v_num=10]\n",
"Epoch 10: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=1.13, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 10: 100%|██████████| 50/50 [00:19<00:00, 2.51it/s, loss=1.13, v_num=10]\n",
"Epoch 11: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=3.07, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 11: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=3.07, v_num=10]\n",
"Epoch 12: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=1.93, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 12: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=1.93, v_num=10]\n",
"Epoch 13: 80%|████████ | 40/50 [00:15<00:03, 2.61it/s, loss=4.4, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 13: 100%|██████████| 50/50 [00:19<00:00, 2.58it/s, loss=4.4, v_num=10]\n",
"Epoch 14: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=0.537, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 14: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=0.537, v_num=10]\n",
"Epoch 15: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=0.765, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 15: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=0.765, v_num=10]\n",
"Epoch 16: 80%|████████ | 40/50 [00:15<00:03, 2.61it/s, loss=4.24, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 16: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=4.24, v_num=10]\n",
"Epoch 17: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=3.98, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 17: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=3.98, v_num=10]\n",
"Epoch 18: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=4.54, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 18: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=4.54, v_num=10]\n",
"Epoch 19: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=4.58, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 19: 100%|██████████| 50/50 [00:19<00:00, 2.57it/s, loss=4.58, v_num=10]\n",
"Epoch 20: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=8.56, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 20: 100%|██████████| 50/50 [00:19<00:00, 2.57it/s, loss=8.56, v_num=10]\n",
"Epoch 21: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=2.12, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 21: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=2.12, v_num=10]\n",
"Epoch 22: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=4.19, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 22: 100%|██████████| 50/50 [00:19<00:00, 2.57it/s, loss=4.19, v_num=10]\n",
"Epoch 23: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=2.29, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 23: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=2.29, v_num=10]\n",
"Epoch 24: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=0.797, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 24: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=0.797, v_num=10]\n",
"Epoch 25: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=3.2, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 25: 100%|██████████| 50/50 [00:19<00:00, 2.57it/s, loss=3.2, v_num=10]\n",
"Epoch 26: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=1.87, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 26: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=1.87, v_num=10]\n",
"Epoch 27: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=4.19, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 27: 100%|██████████| 50/50 [00:19<00:00, 2.57it/s, loss=4.19, v_num=10]\n",
"Epoch 28: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=1.29, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 28: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=1.29, v_num=10]\n",
"Epoch 29: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=1.56, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 29: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=1.56, v_num=10]\n",
"Epoch 30: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=5.34, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 30: 100%|██████████| 50/50 [00:19<00:00, 2.54it/s, loss=5.34, v_num=10]\n",
"Epoch 31: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=5.35, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 31: 100%|██████████| 50/50 [00:20<00:00, 2.49it/s, loss=5.35, v_num=10]\n",
"Epoch 32: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=4.49, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 32: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=4.49, v_num=10]\n",
"Epoch 33: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=6.92, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 33: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=6.92, v_num=10]\n",
"Epoch 34: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=6.19, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 34: 100%|██████████| 50/50 [00:19<00:00, 2.53it/s, loss=6.19, v_num=10]\n",
"Epoch 35: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=3.94, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 35: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=3.94, v_num=10]\n",
"Epoch 36: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=3.46, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 36: 100%|██████████| 50/50 [00:19<00:00, 2.51it/s, loss=3.46, v_num=10]\n",
"Epoch 37: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=6.17, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 37: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=6.17, v_num=10]\n",
"Epoch 38: 80%|████████ | 40/50 [00:16<00:04, 2.47it/s, loss=1.25, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 38: 100%|██████████| 50/50 [00:21<00:00, 2.35it/s, loss=1.25, v_num=10]\n",
"Epoch 39: 80%|████████ | 40/50 [00:16<00:04, 2.39it/s, loss=3.26, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 39: 100%|██████████| 50/50 [00:20<00:00, 2.40it/s, loss=3.26, v_num=10]\n",
"Epoch 40: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=2.13, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 40: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=2.13, v_num=10]\n",
"Epoch 41: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=5.44, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 41: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=5.44, v_num=10]\n",
"Epoch 42: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=2.42, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 42: 100%|██████████| 50/50 [00:19<00:00, 2.54it/s, loss=2.42, v_num=10]\n",
"Epoch 43: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=1.52, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 43: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=1.52, v_num=10]\n",
"Epoch 44: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=7.1, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 44: 100%|██████████| 50/50 [00:19<00:00, 2.54it/s, loss=7.1, v_num=10]\n",
"Epoch 45: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=3.82, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 45: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=3.82, v_num=10]\n",
"Epoch 46: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=6.59, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 46: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=6.59, v_num=10]\n",
"Epoch 47: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=5.94, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 47: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=5.94, v_num=10]\n",
"Epoch 48: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=3.71, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 48: 100%|██████████| 50/50 [00:19<00:00, 2.54it/s, loss=3.71, v_num=10]\n",
"Epoch 49: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=2.79, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 49: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=2.79, v_num=10]\n",
"Epoch 50: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=2.85, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 50: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=2.85, v_num=10]\n",
"Epoch 51: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=4.34, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 51: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=4.34, v_num=10]\n",
"Epoch 52: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=2.89, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 52: 100%|██████████| 50/50 [00:19<00:00, 2.57it/s, loss=2.89, v_num=10]\n",
"Epoch 53: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=6.18, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 53: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=6.18, v_num=10]\n",
"Epoch 54: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=2.74, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 54: 100%|██████████| 50/50 [00:19<00:00, 2.52it/s, loss=2.74, v_num=10]\n",
"Epoch 55: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=3.55, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 55: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=3.55, v_num=10]\n",
"Epoch 56: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=8.85, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 56: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=8.85, v_num=10]\n",
"Epoch 57: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=4.25, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 57: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=4.25, v_num=10]\n",
"Epoch 58: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=3.54, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 58: 100%|██████████| 50/50 [00:19<00:00, 2.57it/s, loss=3.54, v_num=10]\n",
"Epoch 59: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=2.78, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 59: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=2.78, v_num=10]\n",
"Epoch 60: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=1.7, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 60: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=1.7, v_num=10]\n",
"Epoch 61: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=2.27, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 61: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=2.27, v_num=10]\n",
"Epoch 62: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=8.08, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 62: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=8.08, v_num=10]\n",
"Epoch 63: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=1.64, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 63: 100%|██████████| 50/50 [00:19<00:00, 2.51it/s, loss=1.64, v_num=10]\n",
"Epoch 64: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=2.46, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 64: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=2.46, v_num=10]\n",
"Epoch 65: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=1.14, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 65: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=1.14, v_num=10]\n",
"Epoch 66: 80%|████████ | 40/50 [00:15<00:03, 2.58it/s, loss=4.46, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 66: 100%|██████████| 50/50 [00:20<00:00, 2.50it/s, loss=4.46, v_num=10]\n",
"Epoch 67: 80%|████████ | 40/50 [00:15<00:03, 2.60it/s, loss=2.56, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 67: 100%|██████████| 50/50 [00:19<00:00, 2.56it/s, loss=2.56, v_num=10]\n",
"Epoch 68: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=7.5, v_num=10] \n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 68: 100%|██████████| 50/50 [00:19<00:00, 2.54it/s, loss=7.5, v_num=10]\n",
"Epoch 69: 80%|████████ | 40/50 [00:17<00:04, 2.30it/s, loss=3.54, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 69: 100%|██████████| 50/50 [00:21<00:00, 2.30it/s, loss=3.54, v_num=10]\n",
"Epoch 70: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=2.62, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 70: 100%|██████████| 50/50 [00:19<00:00, 2.54it/s, loss=2.62, v_num=10]\n",
"Epoch 71: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=5.42, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 71: 100%|██████████| 50/50 [00:19<00:00, 2.55it/s, loss=5.42, v_num=10]\n",
"Epoch 72: 80%|████████ | 40/50 [00:15<00:03, 2.59it/s, loss=3.48, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 72: 100%|██████████| 50/50 [00:19<00:00, 2.51it/s, loss=3.48, v_num=10]\n",
"Epoch 73: 80%|████████ | 40/50 [00:15<00:03, 2.57it/s, loss=4.05, v_num=10]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A\n",
"Epoch 73: 100%|██████████| 50/50 [00:19<00:00, 2.54it/s, loss=4.05, v_num=10]\n",
"Epoch 74: 20%|██ | 10/50 [00:07<00:28, 1.40it/s, loss=5.2, v_num=10] \n"
"Epoch 0: 94%|█████████▍| 430/456 [00:30<00:01, 14.09it/s, loss=0.0303, v_num=8]\n",
"Validating: 0it [00:00, ?it/s]\u001b[A"
]
},
{
"data": {
"text/plain": [
"1"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
"ename": "MisconfigurationException",
"evalue": "ModelCheckpoint(monitor='val_loss') not found in the returned metrics: ['train_loss']. HINT: Did you call self.log('val_loss', tensor) in the LightningModule?",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py\u001b[0m in \u001b[0;36mtrain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 520\u001b[0m \u001b[0;31m# run train epoch\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 521\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain_loop\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_training_epoch\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 522\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/trainer/training_loop.py\u001b[0m in \u001b[0;36mrun_training_epoch\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 587\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mshould_check_val\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 588\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_evaluation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtest_mode\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 589\u001b[0m \u001b[0;31m# reset stage to train\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py\u001b[0m in \u001b[0;36mrun_evaluation\u001b[0;34m(self, test_mode, max_batches)\u001b[0m\n\u001b[1;32m 592\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 593\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mbatch_idx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbatch\u001b[0m \u001b[0;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataloader\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 594\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mbatch\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/torch/utils/data/dataloader.py\u001b[0m in \u001b[0;36m__next__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 434\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_reset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 435\u001b[0;31m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_next_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 436\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_num_yielded\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/torch/utils/data/dataloader.py\u001b[0m in \u001b[0;36m_next_data\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1064\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_task_info\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_rcvd_idx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1065\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_process_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1066\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/torch/utils/data/dataloader.py\u001b[0m in \u001b[0;36m_process_data\u001b[0;34m(self, data)\u001b[0m\n\u001b[1;32m 1110\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mExceptionWrapper\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1111\u001b[0;31m \u001b[0mdata\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreraise\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1112\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/torch/_utils.py\u001b[0m in \u001b[0;36mreraise\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexc_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexc_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mFileNotFoundError\u001b[0m: Caught FileNotFoundError in DataLoader worker process 3.\nOriginal Traceback (most recent call last):\n File \"/home/matej/miniconda/envs/fitmvi/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py\", line 198, in _worker_loop\n data = fetcher.fetch(index)\n File \"/home/matej/miniconda/envs/fitmvi/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py\", line 44, in fetch\n data = [self.dataset[idx] for idx in possibly_batched_index]\n File \"/home/matej/miniconda/envs/fitmvi/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py\", line 44, in <listcomp>\n data = [self.dataset[idx] for idx in possibly_batched_index]\n File \"/home/matej/ni-mvi-sp-2020-chomamat/core/datasets.py\", line 60, in __getitem__\n LR = self._load_img(self.lr[index])\n File \"/home/matej/ni-mvi-sp-2020-chomamat/core/datasets.py\", line 37, in _load_img\n img = np.array(Image.open(path).convert('RGB'))\n File \"/home/matej/miniconda/envs/fitmvi/lib/python3.8/site-packages/PIL/Image.py\", line 2891, in open\n fp = builtins.open(filename, \"rb\")\nFileNotFoundError: [Errno 2] No such file or directory: '/home/matej/ni-mvi-sp-2020-chomamat/data/datasets/DIV2K/valid_LR_250_unknown/00029.png'\n",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mMisconfigurationException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-e1830a3e3911>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0mprogress_bar_refresh_rate\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 16\u001b[0m )\n\u001b[0;32m---> 17\u001b[0;31m \u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrain_loader\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mval_loader\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, model, train_dataloader, val_dataloaders, datamodule)\u001b[0m\n\u001b[1;32m 468\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcall_hook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'on_fit_start'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 469\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 470\u001b[0;31m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maccelerator_backend\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 471\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maccelerator_backend\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mteardown\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 472\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/accelerators/gpu_accelerator.py\u001b[0m in \u001b[0;36mtrain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0;31m# train or test\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 68\u001b[0;31m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain_or_test\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 69\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresults\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/accelerators/accelerator.py\u001b[0m in \u001b[0;36mtrain_or_test\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_test\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 69\u001b[0;31m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 70\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresults\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 71\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py\u001b[0m in \u001b[0;36mtrain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 551\u001b[0m \u001b[0;31m# hook\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 552\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain_loop\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_train_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 553\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 554\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mrun_evaluation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtest_mode\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_batches\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/trainer/training_loop.py\u001b[0m in \u001b[0;36mon_train_end\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[0;31m# when a checkpoint was saved at the last step\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 190\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mglobal_step\u001b[0m \u001b[0;34m-=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 191\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcheck_checkpoint_callback\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mshould_save\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mis_last\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 192\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mglobal_step\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 193\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/trainer/training_loop.py\u001b[0m in \u001b[0;36mcheck_checkpoint_callback\u001b[0;34m(self, should_save, is_last)\u001b[0m\n\u001b[1;32m 223\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 224\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mcallback\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcheckpoint_callbacks\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 225\u001b[0;31m \u001b[0mcallback\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_validation_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 226\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mon_train_epoch_start\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mepoch\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/callbacks/model_checkpoint.py\u001b[0m in \u001b[0;36mon_validation_end\u001b[0;34m(self, trainer, pl_module)\u001b[0m\n\u001b[1;32m 201\u001b[0m \u001b[0mcheckpoints\u001b[0m \u001b[0mcan\u001b[0m \u001b[0mbe\u001b[0m \u001b[0msaved\u001b[0m \u001b[0mat\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mend\u001b[0m \u001b[0mof\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mval\u001b[0m \u001b[0mloop\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 202\u001b[0m \"\"\"\n\u001b[0;32m--> 203\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave_checkpoint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpl_module\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 204\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 205\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mon_save_checkpoint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrainer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpl_module\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mDict\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/callbacks/model_checkpoint.py\u001b[0m in \u001b[0;36msave_checkpoint\u001b[0;34m(self, trainer, pl_module)\u001b[0m\n\u001b[1;32m 234\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 235\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_add_backward_monitor_support\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 236\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_validate_monitor_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 237\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 238\u001b[0m \u001b[0;31m# track epoch when ckpt was last checked\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda/envs/fitmvi/lib/python3.8/site-packages/pytorch_lightning/callbacks/model_checkpoint.py\u001b[0m in \u001b[0;36m_validate_monitor_key\u001b[0;34m(self, trainer)\u001b[0m\n\u001b[1;32m 512\u001b[0m \u001b[0;34mf\"HINT: Did you call self.log('{self.monitor}', tensor) in the LightningModule?\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 513\u001b[0m )\n\u001b[0;32m--> 514\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mMisconfigurationException\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 515\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 516\u001b[0m def _get_metric_interpolated_filepath_name(\n",
"\u001b[0;31mMisconfigurationException\u001b[0m: ModelCheckpoint(monitor='val_loss') not found in the returned metrics: ['train_loss']. HINT: Did you call self.log('val_loss', tensor) in the LightningModule?"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 0: 96%|█████████▋| 440/456 [00:47<00:01, 9.26it/s, loss=0.0303, v_num=8]"
]
}
],
"source": [
......@@ -714,34 +516,12 @@
"torch.sum(-torch.log(torch.ones(1, 1)))"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3, 64, 64)"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"i.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"1 is GT"
]
"source": []
}
],
"metadata": {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment