zhaoyuzhi / Self-Guided-Network-for-Fast-Image-Denoising

The PyTorch implementation of ICCV 2019 paper SGN
44 stars 6 forks source link

About training data #2

Open savokiiihjm opened 4 years ago

savokiiihjm commented 4 years ago

Can you teach me how to use my own training data

zhaoyuzhi commented 4 years ago

in train.py, change the argument baseroot to your data path; for details, please refer to my dataset.py part

savokiiihjm commented 4 years ago

I have a new question, why do I report an error when I change the image in “noisy_img_examples” to my own image. Is there a requirement for training data? Thank you for your reply.

------------------ 原始邮件 ------------------ 发件人: "Yuzhi ZHAO"<notifications@github.com>; 发送时间: 2019年12月26日(星期四) 晚上10:16 收件人: "zhaoyuzhi/Self-Guided-Network-for-Fast-Image-Denoising"<Self-Guided-Network-for-Fast-Image-Denoising@noreply.github.com>; 抄送: "wefw"<1315897148@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [zhaoyuzhi/Self-Guided-Network-for-Fast-Image-Denoising] About training data (#2)

in train.py, change the argument baseroot to your data path; for details, please refer to my dataset.py part

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhaoyuzhi commented 4 years ago

Could you please pose your bug log?

savokiiihjm commented 4 years ago

I found my mistake through inspection, thank you for your help

savokiiihjm commented 4 years ago

Sorry to bother you again. This error occurred when I tested the model. How to solve it.

recon_img = model(noisy_img) TypeError: 'collections.OrderedDict' object is not callable

zhaoyuzhi commented 4 years ago

Hi, it is my mistake. It returns TypeError because your saved pth file is just weights, not the model. please change the line in test.py

model = utils.create_generator(opt)

or you can just download the new test.py

Regards, Zhao

savokiiihjm commented 4 years ago

Thank you,  I will change it and test my model.

---Original--- From: "Yuzhi ZHAO"<notifications@github.com> Date: Sun, Dec 29, 2019 15:42 PM To: "zhaoyuzhi/Self-Guided-Network-for-Fast-Image-Denoising"<Self-Guided-Network-for-Fast-Image-Denoising@noreply.github.com>; Cc: "savokiiihjm"<1315897148@qq.com>;"Author"<author@noreply.github.com>; Subject: Re: [zhaoyuzhi/Self-Guided-Network-for-Fast-Image-Denoising] About training data (#2)

Hi, it is my mistake. It returns TypeError because your saved pth file is just weights, not the model. please change the line in test.py model = utils.create_generator(opt)

or you can just download the new test.py

Regards, Zhao

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

savokiiihjm commented 4 years ago

When I changed the test set, the program reported an error:RuntimeError: Calculated padded input size per channel: (32 x 1). Kernel size: (2 x 2). Kernel size can't be greater than actual input size

savokiiihjm commented 4 years ago

recon_img = model(noisy_img) in this sentence

zhaoyuzhi commented 4 years ago

How large is the size?

savokiiihjm commented 4 years ago

My data set is 6464 , I can change it into 256256. But I want to know how to make the network detect other sizes of data

zhaoyuzhi commented 4 years ago

It is a fully-convolutional network so it works well for any resolution. However, for this model, it exists down-sample operation. Therefore, you should ensure the least resolution >=1. You may print the shape at the shallowest part of SGN.

savokiiihjm commented 4 years ago

I'll try as you say,Thank you

------------------ 原始邮件 ------------------ 发件人: "Yuzhi ZHAO"<notifications@github.com>; 发送时间: 2020年1月2日(星期四) 下午5:35 收件人: "zhaoyuzhi/Self-Guided-Network-for-Fast-Image-Denoising"<Self-Guided-Network-for-Fast-Image-Denoising@noreply.github.com>; 抄送: "wefw"<1315897148@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [zhaoyuzhi/Self-Guided-Network-for-Fast-Image-Denoising] About training data (#2)

It is a fully-convolutional network so it works well for any resolution. However, for this model, it exists down-sample operation. Therefore, you should ensure the least resolution >=1. You may print the shape at the shallowest part of SGN.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

savokiiihjm commented 4 years ago

Sorry to bother you again. How can I modify the code so that I can test the 64 * 64 test set.

zhaoyuzhi commented 4 years ago

decrease down-sample time

savokiiihjm commented 4 years ago

Where should I change the parameters

zhaoyuzhi commented 4 years ago

network.py you define a new network to fit your situation.

savokiiihjm commented 4 years ago

Can you tell me how to modify network.py in more detail? I didn't successfully test the dataset after I modified it. Thank you!

savokiiihjm commented 4 years ago

Why can't we test with the test picture given in the code

zhaoyuzhi commented 4 years ago

Have you check image resolution? In the paper it is 256 256. If you still use 64 64, modify network architecture to fit your condition.

savokiiihjm commented 4 years ago

I used the test image in the code. The size of the image is 256 * 256, but when I run the test function, I still get an error: RuntimeError: Calculated padded input size per channel: (128 x 1). Kernel size: (2 x 2). Kernel size can't be greater than actual input size

savokiiihjm commented 4 years ago

What is the function of pixel_ Unsuffle

zhaoyuzhi commented 4 years ago

inverse of pixel_shuffle

savokiiihjm commented 4 years ago

I've tried many times to test data that still doesn't work. Can you give me a script to test 256 * 256 data. Thank you

savokiiihjm commented 4 years ago

When I set pre_train = false, the following problem occurs: attributeerror: 'collections. Ordereddict' object has no attribute 'state_dict'

savokiiihjm commented 4 years ago

Can you give me a test.py that can run directly? The test data is 256 * 256

savokiiihjm commented 4 years ago

In network.py, 'X1 = pixel unshuffle. Pixel_unsuffle (x, 2)' x should be a torch. Size ([1, 3, 256, 256]) But I found that x is torch. Size ([1, 3, 256, 2]), This is a problem at present. What is the cause of this problem and how should I solve it.

savokiiihjm commented 4 years ago

Please give me an answer when you are free.Thank you

zhaoyuzhi commented 4 years ago

ok, I will train one for testing. I may be busy this days

zhaoyuzhi commented 4 years ago

Hey, you may have a look at new issue: https://github.com/zhaoyuzhi/Self-Guided-Network-for-Fast-Image-Denoising/issues/3