日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

EDSR-PyTorch复现

發(fā)布時間:2025/3/19 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 EDSR-PyTorch复现 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1. 下載模型

先去下載預(yù)訓(xùn)練模型,然后放到相應(yīng)路徑,https://cv.snu.ac.kr/research/EDSR/model_pytorch.tar?,最后在運(yùn)行命令中的--pre_train指定模型路徑。

?

2. 遇到的問題及相應(yīng)解決方案

1.?Can't pickle local object 'checkpoint.begin_background..bg_target'

解決:去掉命令中的--save_results參數(shù),然后要保存圖像處理結(jié)果的話,直接寫代碼,代碼(轉(zhuǎn)自https://github.com/thstkdgus35/EDSR-PyTorch/issues/91)如附錄1

2.'checkpoint' object has no attribute 'queue'(注釋了程序中--save_results相關(guān)代碼導(dǎo)致)

解決:把程序src/trainer.py 中和save_results相關(guān)的代碼全都注釋干凈如附錄二

3. while copying the parameter named head.0.weight, whose dimensions in the model are torch.Size([64,3,3,3]) and whose dimensions in checkpoint is torch.Size([256,3,3,3])

解決:在運(yùn)行命令中加上 --n_resblocks 32 --n_feats 256 --res_scale 0.1 參數(shù)。

4. CUDA:out of memory

解決:圖像尺寸太大,加上--chop參數(shù),讓程序?qū)D片進(jìn)行自動分割處理。

5. 其它問題及解決方案鏈接

https://github.com/thstkdgus35/EDSR-PyTorch/issues/184

https://github.com/thstkdgus35/EDSR-PyTorch/issues/91

?

3. 測試

python main.py --data_test Demo --scale 4 --n_resblocks 32 --n_feats 256 --res_scale 0.1 --pre_train ..\\models\\EDSR_x4.pt --test_only

?

4. 附錄?

4.1 附錄1

postfix = ('SR', 'LR', 'HR') for v, p in zip(save_list, postfix):normalized = v[0].mul(255 / self.args.rgb_range)tensor_cpu = normalized.byte().permute(1, 2, 0).cpu()imageio.imwrite(('..\\experiment\\test\\results-{}\\{}_x{}_{}.png'.format(d.dataset.name,filename[0],scale, p)), tensor_cpu.numpy())

?

4.2 附錄2

#if self.args.save_results: self.ckp.begin_background()#if self.args.save_results: # self.ckp.save_results(d, filename[0], save_list, scale)#if self.args.save_results: # self.ckp.end_background()

?

總結(jié)

以上是生活随笔為你收集整理的EDSR-PyTorch复现的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。