Giter VIP home page Giter VIP logo

fried-rice-lab / friedricelab Goto Github PK

View Code? Open in Web Editor NEW
194.0 16.0 32.0 30.84 MB

Official repository of the Fried Rice Lab, including code resources of the following our works: ESWT [arXiv], etc. This repository also implements many useful features and out-of-the-box image restoration models.

License: MIT License

Python 97.83% MATLAB 1.94% Shell 0.22%
basicsr pytorch image-restoration super-resolution denoising deep-learning python eswt

friedricelab's Introduction

Fried Rice Lab

We will release code resources for our works here, including:

  • ESWT [arXiv]

We also implement many useful features, including:

  • Allow free combination of different models and tasks with new run commands (2 Run)
  • Analyse the complexity of a specific model on a specific task (2.3 Analyse)
  • Interpret super-resolution models using local attribute maps (LAM) (2.4 Interpret)
  • Restore your own images using existing models (2.5 Infer)
  • (New!) Measure representational similarity using minibatch centered kernel alignment (2.6 CKA)
  • (New!) Calculate mean attention distance of self-attention (2.7 MAD)
  • (New!) Combine multiple datasets as training set (Combine Dataset)
  • Train/test models with any data flow (Data Flow)
  • Load LMDB databases in a more customizable way (LMDB Loading)

And many out-of-the-box image restoration models, including:

  • 2017: EDSR [CVPRW]
  • 2018: RCAN [ECCV], RDN [CVPR]
  • 2019: IMDN [ACM MM], RNAN [ICLR]
  • 2020: CSNLN [CVPR], LAPAR [NeurIPS], LatticeNet [ECCV], PAN [ECCV], RFDN [ECCV], SAN [CVPR], HAN [ECCV]
  • 2021: FDIWN [AAAI], HSENet [TGRS], SwinIR [ICCV]
  • 2022: BSRN [CVPRW], ELAN [ECCV], ESRT [CVPRW], LBNet [IJCAI], NAFNet [ECCV], RLFN [CVPRW], SCET [CVPRW], MAN [ARXIV], ShuffleMixer [NeurIPS], FMEN [CVPRW], HNCT[CVPRW], EFDN[CVPRW], vapSR[ECCVW]

We hope this repository helps your work.

Table of contents

FRL News

23.02.05 Preview. We are working on a new work on image super-resolution, the performance of which is shown in the figure below. The manuscript and code resources will be released as soon as possible.

23.01.31 Release the code resources of ESWT ๐ŸŽ‰

23.01.24 Release the manuscript of our new work ESWT on arXiv

23.01.11 FRL code v2.0 released

22.11.15 Here we are ๐Ÿชง

Our Works

(ESWT) Image Super-Resolution using Efficient Striped Window Transformer [arXiv]

Jinpeng Shi*^, Hui Li, Tianle Liu, Yulong Liu, Mingjian Zhang, Jinchen Zhu, Ling Zheng, Shizhuang Weng^

Transformers have achieved remarkable results in single-image super-resolution (SR). However, the challenge of balancing model performance and complexity has hindered their application in lightweight SR (LSR). To tackle this challenge, we propose an efficient striped window transformer (ESWT). We revisit the normalization layer in the transformer and design a concise and efficient transformer structure to build the ESWT. Furthermore, we introduce a striped window mechanism to model long-term dependencies more efficiently. To fully exploit the potential of the ESWT, we propose a novel flexible window training strategy that can improve the performance of the ESWT without additional cost. Extensive experiments show that ESWT outperforms state-of-the-art LSR transformers, and achieves a better trade-off between model performance and complexity. The ESWT requires fewer parameters, incurs faster inference, smaller FLOPs, and less memory consumption, making it a promising solution for LSR. [More details and reproduction guidance]

*: (Co-)first author(s)

^: (Co-)corresponding author(s)

How to Use

1 Preparation

1.1 Environment

Use the following command to build the Python environment:

conda create -n frl python
conda activate frl
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # Mainland China only!
pip install torch torchvision basicsr einops timm matplotlib

1.2 Dataset

You can download the datasets you need from our OneDrive and place the downloaded datasets in the folder datasets. To use the YML profile we provide, keep the local folder datasets in the same directory tree as the OneDrive folder datasets.

Task Dataset Relative Path
SISR DF2K datasets/sr_data/DF2K
Set5 datasets/sr_data/Set5
Set14 datasets/sr_data/Set14
BSD100 datasets/sr_data/BSD100
Urban100 datasets/sr_data/Urban100
Manga109 datasets/sr_data/Manga109
Denoising SIDD datasets/denoising_data/SIDD

๐Ÿค  All datasets have been processed in IMDB format and do not require any additional processing. The processing of the SISR dataset refers to the BasicSR document, and the processing of the denoising dataset refers to the NAFNet document.

๐Ÿค  To verify the integrity of your download, please refer to docs/md5.txt.

1.3 Pretraining Weight

You can download the pretraining weights you need from our OneDrive and place the downloaded pretraining weights in the folder modelzoo. To use the YML configuration files we provide, keep the local folder modelzoo in the same directory tree as the OneDrive folder modelzoo.

Source Model Relative Path
Official ESWT modelzoo/ESWT
Unofficial ELAN modelzoo/ELAN

๐Ÿค  The unofficial pre-trained weights are trained by us. The experimental conditions are exactly the same as in their paper.

2 Run

When running the FRL code, unlike BasicSR, you must specify two YML configuration files. The run command should be as follows:

python ${function.py} -expe_opt ${expe.yml} -task_opt ${task.yml}
  • ${function.py} is the function you want to run, e.g. test.py
  • ${expe.yml} is the path to the experimental YML configuration file that contains the model-related and training-related configuration, e.g. expe/ESWT/ESWT_LSR.yml
  • ${task.yml} is the path to the task YML configuration file that contains the task-related configuration, e.g. expe/task/LSR_x4.yml

๐Ÿค  A complete experiment consists of three parts: the data, the model, and the training strategy. This design allows their configuration to be decoupled.

For your convenience, we provide a demo test set datasets/demo_data/Demo_Set5 and a demo pre-training weight modelzoo/ELAN/ESWT-24-6_LSR_x4.pth. Use the following commands to try out the main functions of the FRL code.

2.1 Train

This function will train a specified model.

python train.py -expe_opt options/repr/ESWT/ESWT-24-6_LSR.yml -task_opt options/task/LSR_x4.yml

๐Ÿค  Use the following demo command instead if you prefer to run in CPU mode:

python train.py -expe_opt options/repr/ESWT/ESWT-24-6_LSR.yml -task_opt options/task/LSR_x4.yml --force_yml num_gpu=0

2.2 Test

This function will test the performance of a specified model on a specified task.

python test.py -expe_opt options/repr/ESWT/ESWT-24-6_LSR.yml -task_opt options/task/LSR_x4.yml

2.3 Analyse

This function will analyze the complexity of a specified model on a specified task. Including the following metrics:

  • #Params: total number of learnable parameters

  • #FLOPs: abbreviation of floating point operations

  • #Acts: number of elements of all outputs of convolutional layers

  • #Conv: number of convolutional layers

  • #Memory: maximum GPU memory consumption when inferring a dataset

  • #Ave. Time: average inference time per image in a dataset

python analyse.py -expe_opt options/repr/ESWT/ESWT-24-6_LSR.yml -task_opt options/task/LSR_x4.yml

2.4 Interpret

This function comes from the paper "Interpreting Super-Resolution Networks with Local Attribution Maps". When reconstructing the patches marked with red boxes, a higher DI indicates involving a larger range of contextual information, and a darker color indicates a higher degree of contribution.

python interpret.py -expe_opt options/repr/ESWT/ESWT-24-6_LSR.yml -task_opt options/task/LSR_x4.yml

2.5 Infer

You can use this function to restore your own image.

python infer.py -expe_opt options/repr/ESWT/ESWT-24-6_LSR.yml -task_opt options/task/LSR_x4.yml

2.6 CKA

This function comes from the paper "Do Wide and Deep Networks Learn the Same Things? Uncovering How Neural Network Representations Vary with Width and Depth", which allows you to analyze the feature representation of the SR model.

To get started, use the function cka.py to obtain the output of a specified layer type from a specified model.

python cka.py -expe_opt options/repr/ESWT/ESWT-24-6_LSR.yml -task_opt options/task/LSR_x4.yml --force_yml hook_layer_type=SABase4D

cka

Next, employ the script post_cka.py to process the previously obtained pkl and generate the heat map of representational similarity.

python scripts/post_cka.py results/ESWT-24-6_LSR_x4/ESWT-24-6_LSR_x4_DF2K_val_cka.pkl

cka

2.7 MAD

This function calculates the mean attention distance (MAD) of SA layers of a specified model, which is analogous to the receptive field in CNNs.

To get started, use the function mad.py to obtain the attention weights of SA layers from a specified model.

python mad.py -expe_opt options/repr/ESWT/ESWT-12-12_LSR.yml -task_opt options/task/LSR_x4.yml --force_yml network_g:return_attns=true

mad

Next, employ the script post_mad.py to process the previously obtained pkl and generate the line chart.

python scripts/post_mad.py results/ESWT-12-12_LSR_x4/ESWT-12-12_LSR_x4_DF2K_val_mad.pkl

mad_result

โš ๏ธ Please note that the function mad.py only supports SABase4D and square local windows currently. We will release the code for non-square partial windows later.

Useful Features

Combine Dataset

The FRL code provides a flexible way to combine training datasets using the parameter extra_datasets. Here is a demo YML profile:

datasets:
  train:
    name: FirstDataset
    type: IRDataset
    dataroot_gt: path/to/first/dataset/HR
    dataroot_lq: path/to/first/dataset/LR

    extra_datasets:
      extra_0:
    		name: SecondDataset # Use the type of the first dataset
    		dataroot_gt: path/to/second/dataset/HR
    		dataroot_lq: path/to/second/dataset/LR

      extra_1:
    		name: ThirdDataset # Use the type of the first dataset
    		dataroot_gt: path/to/third/dataset/HR
    		dataroot_lq: path/to/third/dataset/LR

This will combine multiple data sets into one training set:

combine_dataset

๐Ÿค  This is a simple way to process the new data set LSDIR (Large Scale Dataset for Image Restoration).

Data Flow

The image restoration process based on the BasicSR is as follows:

              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚  image  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚  model  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚  image  โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ pre-processing โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ post-processing โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

By default, the pre-processing operation normalizes the input image of any bit range (e.g., an 8-bit RGB image) to the [0, 1] range, and the post-processing operation restores the output image to the original bit range. The default data flow is shown below:

              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚ 0-2^BIT โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚   0-1   โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ 0-2^BIT โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

However, for some input images (e.g., 16-bit TIF images), this data flow may lead to unstable training or degraded performance. Therefore, the FRL code provides support for data flows of any bit range. The new data flows are shown below:

              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚ 0-2^BIT โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ 0-2^bit โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ 0-2^BIT โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

You can try different data flows by simply changing the parameter bit in the file ${expe.yml}. Set it to 0 to use the default data flow of BasicSR.

๐Ÿค  We tested the impact of different data flows on the SISR task (by retraining the EDSR, RFDN, and ELAN models using 8-bit RGB images). The results show that 8-bit models (trained with 8-bit data flow) perform slightly better than 0-bit models.

โš ๏ธ We did not test the impact of different data flows on other image restoration tasks.

โš ๏ธ Using new data flows may lead to inaccurate metric results (PSNR: error less than 0.001; SSIM: error less than 0.00001). To get more accurate metric results, use scripts/evaluate.m instead.

LMDN Loading

A standard BasicSR LMDB database structure is as follows:

                                        demo.lmdb
                                        โ”œโ”€โ”€ data.mdb
                                        โ”œโ”€โ”€ lock.mdb
                                        โ””โ”€โ”€ meta_info.txt

By default, BasicSR automatically reads the file demo.lmdb/meta_info.txt when loading the LMDB database. In the FRL code, you can specify the file meta_info.txt to be used when loading the LMDB database. This makes it easier to process datasets, such as splitting a dataset into a training set and a test set.

๐Ÿค  The LMDB database of BasicSR has a unique form. More information about LMBD database and file mateinfo.txt can be found in the BasicSR document.

Model Customization

Different from BasicSR, all models in the FRL code must have the following four parameters:

  • upscale: upscale factor, e.g: 2, 3, and 4 for lsr task, 1 for denoising task
  • num_in_ch: input channel number
  • num_out_ch: output channel number
  • task: image restoration task, e.g: lsr, csr or denoising

A demo model implementation is as follows:

import torch


class DemoModel(torch.nn.Module):
    def __init__(self, upscale: int, num_in_ch: int, num_out_ch: int, task: str,  # noqa
                 num_groups: int, num_blocks: int, *args, **kwargs) -> None:  # noqa
        super().__init__()

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        pass

๐Ÿค  The FRL code automatically assigns values to these parameters based on the task configuration file used, so you do not need to define them in the parameter network_g.

network_g:
   type: DemoModel
   # Only the following parameters are required!
   num_groups: 20
   num_blocks: 10

Out-Of-The-Box Models

Standing on the shoulders of giants allows us to grow quickly. So, we implemented many out-of-the-box image restoration models that may help your work. Please refer to the folder archs and the folder options/expe for more details.

You can use the following command out of the box!

# train EDSR to solve 2x classic super-resolution task
python train.py -expe_opt options/expe/EDSR/EDSR_CSR.yml -task_opt options/task/CSR_x2.yml

# test the performance of IMDN on 3x lightweight super-resolution task
python test.py -expe_opt options/expe/IMDN/IMDN_LSR.yml -task_opt options/task/LSR_x3.yml

# analyse the complexity of RFDN on 4x classic lightweight super-resolution task
python analyse.py -expe_opt options/expe/RFDN/RFDN_LSR.yml -task_opt options/task/LSR_x4.yml

We provide many experimental and task YML configuration files. To perform different experiments, feel free to combine them in the command.

๐Ÿค  If these implementations help your work, please consider citing them. Please refer to file docs/third_party_works.bib for more information.

Acknowledgements

This code is mainly based on BasicSR. We thank its developers for creating such a useful toolbox. The code of the function analyse is based on NTIRE2022 ESR, and the code of the function interpret is based on LAM. All other image restoration model codes are from their official GitHub. More details can be found in their implementations.

Contact

This repository is maintained by Jinpeng Shi ([email protected]). Special thanks to Tianle Liu ([email protected]) for his excellent work on code testing. Due to our limited capacity, we welcome any PR.

friedricelab's People

Contributors

eltociear avatar jnpngshiii avatar tianle233 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

friedricelab's Issues

LAMๅฏ่ง†ๅŒ–

ๆ‚จๅฅฝ๏ผŒๆ‚จ็š„ๅทฅไฝœ้žๅธธinteresting๏ผŒ่ฏท้—ฎๆ‚จ็š„LAMๅฏ่ง†ๅŒ–ๆ˜ฏๅฆ‚ไฝ•ๅฎž็Žฐๅ‘ข

GPU

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 152.00 MiB (GPU 0; 23.65 GiB total capacity; 21.52 GiB already allocated; 134.25 MiB free; 22.66 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
ไธคๅผ 4090๏ผŒ่ฏท้—ฎไธบไป€ไนˆไธ€่ฝฎไนŸๆฒก่ท‘ๅฐฑๆ็คบ่ฟ™ๆ ทไบ†ๅ‘ข๏ผŒ่งฃ็ญ”ไปฅไธ€ไธ‹ๅง๏ผŒ่ฐข่ฐข

ๆจกๅž‹

่ฏท้—ฎ่ฟ™ไธชๆจกๅž‹ๆ‚จๅœจไป€ไนˆGPUไธŠ่ฟ›่กŒ็š„๏ผŒ่Šฑ่ดนไบ†ๅคš้•ฟๆ—ถ้—ด

Questions about visualization

The LAM results for different networks are visualized in the paper "Interpreting super-resolution net- works with local attribution maps", but I can't find the code for it? I would like to ask the author how to implement the results of this part of the visualization?

FLOPs Calculation

Hey there,

I'm really impressed with the work you've put into SR. Quick question: does the FLOPs calculation also cover the FLOPs of the Transformer blocks? Excited to hear back from you. Thanks!

About YML config

ๆ‚จๅฅฝ๏ผŒๆ„Ÿ่ฐขๆ‚จๆไพ›้žๅธธๆฃ’็š„FRL ้กน็›ฎ๏ผŒไฝ†ๆˆ‘ๆœ‰ไธ€ไธช็–‘้—ฎ๏ผŒไธบไป€ไนˆFRL้œ€่ฆๆไพ›ไธคไธชymlๆ–‡ไปถ๏ผŒ่ฟ™ๆ ทๅšๅ’ŒbasicSR็›ธๆฏ”็š„ๅฅฝๅค„ๅœจๅ“ช๏ผŸ๏ผˆๆˆ‘็œ‹ๅˆฐๅœจtask.ymlไธญๅฏไปฅๆ นๆฎไปปๅŠกไธๅŒๆไพ›ๆ•ฐๆฎ้›†๏ผŒไฝ†ๆ˜ฏไนŸๅคšไบ†ๅพˆๅคšๅ…ถไป–ๅ‚ๆ•ฐ๏ผŒๆฏ”ๅฆ‚hook_layer_type็ญ‰๏ผ‰

้‡ๅปบๅŽๅ›พๅƒ็š„ไฟๅญ˜ไฝ็ฝฎ

ๅฐŠๆ•ฌ็š„็ ”็ฉถ่€…ๆ‚จๅฅฝ๏ผŒๆˆ‘ๅœจๅˆฉ็”จ่ฏฅ็ฝ‘็ปœ่ฟ›่กŒๅŸบๅ‡†ๆ•ฐๆฎ้›†็š„ๆต‹่ฏ•ๆ—ถๅ‘็Žฐ๏ผŒๅฐฝ็ฎกlog็ป™ๅ‡บไบ†ๆต‹่ฏ•็ป“ๆžœ็š„PSNRๅ’ŒSSIMๆŒ‡ๆ ‡๏ผŒไฝ†ๆ˜ฏๆˆ‘ๆ— ๆณ•ๆ‰พๅˆฐ้‡ๅปบไน‹ๅŽ็š„ๅ›พๅƒๆ”พๅœจไบ†ๅ“ช้‡Œ๏ผŒ่ฏท้—ฎ่ฟ™ไธช้—ฎ้ข˜ๆˆ‘ๅบ”่ฏฅๆ€Žไนˆ่งฃๅ†ณๅ‘ข๏ผŸ

About Pretraining Weight, PSNR and SSIM for x2x3

Hello, your work is very helpful to us. May I ask if it is convenient for you to provide us with Pretraining Weight, PSNR and SSIM for x2x3 to help us with our research? Thank you very much for sharing!

About New item

Hello, your work has been extremely beneficial to us. I wonder if you have plans to integrate "TLC: Improving image restoration by revisiting global information aggregation" into your project? This is also a very useful technique for super-resolution. If possible, we hope that you can integrate it into your project. Thank you.

About Flops

Hello, when I apply the Analyse integrated with your project to test my model, it prompts Cuda out of memory, but after commenting out Flops it works fine.Is there any other way to test Flops? We noticed that your project only uses one graphics card for testing when performing analyse, what should I type on the command line if I want to use two cards to test flops?

Error using denoising task

Hi, first at all great work guys!!
I'm trying to use the denoising task and using the following command:
python infer.py -expe_opt options/repr/ESWT/ESWT-12-12_LSR.yml -task_opt options/task/Denoising.yml
got the next output:

Traceback (most recent call last):
  File "infer.py", line 61, in <module>
    infer_pipeline(root_path)
  File "infer.py", line 47, in infer_pipeline
    model = build_model(opt)
  File "/home/cuchuflito/.local/lib/python3.8/site-packages/basicsr/models/__init__.py", line 26, in build_model
    model = MODEL_REGISTRY.get(opt['model_type'])(opt)
  File "/home/cuchuflito/Documents/adaviv/notebook/image-denoising/FriedRiceLab/models/ir_model.py", line 26, in __init__
    super(IRModel, self).__init__(opt)
  File "/home/cuchuflito/.local/lib/python3.8/site-packages/basicsr/models/sr_model.py", line 30, in __init__
    self.load_network(self.net_g, load_path, self.opt['path'].get('strict_load_g', True), param_key)
  File "/home/cuchuflito/.local/lib/python3.8/site-packages/basicsr/models/base_model.py", line 303, in load_network
    net.load_state_dict(load_net, strict=strict)
  File "/home/cuchuflito/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1482, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for ESWT:
	size mismatch for tail.0.weight: copying a param with shape torch.Size([48, 60, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 60, 3, 3]).
	size mismatch for tail.0.bias: copying a param with shape torch.Size([48]) from checkpoint, the shape in current model is torch.Size([3]).

Do you have any advice? Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.