<jupyter_start><jupyter_text>Install packagesList of packages that work for the code*   https://github.com/saeed-anwar/DRLN/issues/12<jupyter_code>from google.colab import drive
drive.mount('/content/drive')
!pip uninstall --y torchvision
!pip uninstall --y torch
!pip uninstall --y scipy
!pip install -q torch==1.1.0 torchvision==0.3.0
!pip install scipy==1.1.0 # https://github.com/saeed-anwar/DRLN/issues/11
import torch
print(torch.__version__)<jupyter_output>1.1.0<jupyter_text>Download code<jupyter_code>!git clone https://github.com/Luxi-Zhao/SingleImageSuperResolution.git<jupyter_output>Cloning into 'SingleImageSuperResolution'...
remote: Enumerating objects: 298, done.[K
remote: Counting objects: 100% (298/298), done.[K
remote: Compressing objects: 100% (210/210), done.[K
remote: Total 298 (delta 113), reused 253 (delta 68), pack-reused 0[K
Receiving objects: 100% (298/298), 16.96 MiB | 33.27 MiB/s, done.
Resolving deltas: 100% (113/113), done.<jupyter_text>Download DIV2K<jupyter_code>!wget http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_train_LR_bicubic_X2.zip
!wget http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_LR_bicubic_X2.zip
!wget http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_train_HR.zip
!wget http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_HR.zip
!mkdir DIV2K
!unzip -q DIV2K_valid_LR_bicubic_X2.zip -d DIV2K
!unzip -q DIV2K_train_LR_bicubic_X2.zip -d DIV2K
!unzip -q DIV2K_train_HR.zip -d DIV2K
!unzip -q DIV2K_valid_HR.zip -d DIV2K
mv DIV2K/DIV2K_valid_HR/* DIV2K/DIV2K_train_HR/
mv DIV2K/DIV2K_valid_LR_bicubic/X2/* DIV2K/DIV2K_train_LR_bicubic/X2/<jupyter_output><empty_output><jupyter_text>Train model<jupyter_code>GDRIVE = '/content/drive/MyDrive/2516'
experiment_name = 'RDN_50epoch_AblateCM_Bicubic'
CODE_DIR = '/content/SingleImageSuperResolution/TestCode' 
first_run = False
data_prep = 'sep_reset' if first_run else 'sep' 
mkdir {GDRIVE}/{experiment_name}
cd {CODE_DIR}/code
!git checkout rdn-ablate-cm
!python main.py --ext_save_path {GDRIVE}/{experiment_name} --save_model_every 10 --RDNconfig C --dir_data ../../.. --ext {data_prep} --scale 2 --model RDN --epochs 50 --patch_size 32 --chop --save {experiment_name}<jupyter_output>Making model...
Preparing loss function:
1.000 * L1
[Epoch 1]	Learning rate: 1.00e-4
[1600/16000]	[L1: 22.5767]	14.9+0.3s
[3200/16000]	[L1: 15.5390]	14.8+0.0s
[4800/16000]	[L1: 12.6683]	14.4+0.0s
[6400/16000]	[L1: 11.0776]	15.1+0.0s
[8000/16000]	[L1: 10.0532]	14.8+0.0s
[9600/16000]	[L1: 9.2982]	14.9+0.0s
[11200/16000]	[L1: 8.7401]	14.8+0.0s
[12800/16000]	[L1: 8.3029]	14.7+0.0s
[14400/16000]	[L1: 7.9407]	14.9+0.0s
[16000/16000]	[L1: 7.6446]	14.7+0.0s

Evaluation:
100%|███████████████████████████████████████████| 10/10 [00:46<00:00,  4.66s/it]
[DIV2K x2]	PSNR: 34.867 (Best: 34.867 @epoch 1)
Total time: 46.62s, ave time: 4.66s

[Epoch 2]	Learning rate: 1.00e-4
[1600/16000]	[L1: 5.0182]	14.9+0.3s
[3200/16000]	[L1: 5.0874]	14.9+0.0s
[4800/16000]	[L1: 4.9706]	14.6+0.0s
[6400/16000]	[L1: 4.8868]	14.8+0.0s
[8000/16000]	[L1: 4.8544]	14.8+0.0s
[9600/16000]	[L1: 4.8494]	14.7+0.0s
[11200/16000]	[L1: 4.8222]	14.5+0.0s
[12800/16000]	[L1: 4.7875]	14.7+0.0s
[14400/16000]	[L1: 4.7668]	14.6+0.0s
[16000/[...]<jupyter_text>Resume Training<jupyter_code>!python main.py --resume -1 --load {CODE_DIR}/SR/BI/RDN --ext_save_path {GDRIVE}/{experiment_name} --save_model_every 10 --RDNconfig C --dir_data ../../.. --ext sep --scale 2 --model RDN --epochs 50 --patch_size 32 --chop --save {experiment_name} --save_results<jupyter_output><empty_output><jupyter_text>Test Trained Model Load model from checkpoint<jupyter_code>!python main.py --data_test MyImage --scale 2 --RDNconfig C --model RDN --n_feats 64 --pre_train {CODE_DIR}/SR/BI/{experiment_name}/model/model_best.pt --test_only --save_results --chop --save {experiment_name}Test --testpath ../LR/LRBI --testset Set5<jupyter_output>Making model...
Loading model from /content/SingleImageSuperResolution/TestCode/SR/BI/RDN_50epoch_AblateCM_Bicubic/model/model_best.pt

Evaluation:
100%|█████████████████████████████████████████████| 5/5 [00:01<00:00,  2.92it/s]
[MyImage x2]	PSNR: 37.650 (Best: 37.650 @epoch 1)
Total time: 1.72s, ave time: 0.34s<jupyter_text>Save Model<jupyter_code>mkdir /content/{experiment_name}
cp -r {CODE_DIR}/SR/BI/{experiment_name}/* /content/{experiment_name}/
cd /content/
!zip -r -q {experiment_name}.zip {experiment_name}
cp {experiment_name}.zip {GDRIVE}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18461884416460536, 'fraction_numerical': 0.13897009219698672, 'mean_word_length': 4.844940867279895, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '395186', 'license': 'MIT', 'n_tokens_mistral': 2479, 'n_tokens_neox': 2053, 'n_words': 371, 'path': 'ablation_script/RDNAblateCM.ipynb', 'repo_name': 'Luxi-Zhao/SingleImageSuperResolution', 'size': '4447'}