saeed-anwar / RIDNet

Pytorch code for "Real image denoising with feature attention", ICCV (Oral), 2019.
https://saeed-anwar.github.io/publications/
337 stars 57 forks source link

error msg. #6

Closed eastchun closed 4 years ago

eastchun commented 5 years ago

Did anyone run the suggested script correctly? Why do I get the following error?

Making model...
Loading model from ../experiment/ridnet.pt

Evaluation:
0it [00:00, ?it/s]
Traceback (most recent call last):
  File "main.py", line 20, in <module>
    while not t.terminate():
  File "C:\test\RIDNet-pytorch\TestCode\code\trainer.py", line 139, in terminate
    self.test()
  File "C:\test\RIDNet-pytorch\TestCode\code\trainer.py", line 110, in test
    self.ckp.log[-1, idx_scale] = eval_acc / len(self.loader_test)
ZeroDivisionError: division by zero
mmazeika commented 5 years ago

I'm getting the same error.

saeed-anwar commented 5 years ago

Let me see it. I haven't come across this problem before. Looking at the problem seems that the test loader has zero images.

juingzhou commented 5 years ago

How to adapt pytorch 1.0?

saeed-anwar commented 5 years ago

The model works fine with PyTorch 0.4.0 and 0.4.1

The framework is not compatiable with PyTorch 1.0

I will try to update it to the recent PyTorch versions. But it may not be soon enough.

juingzhou commented 5 years ago

self.ckp.log[-1, idx_scale] = eval_acc / len(self.loader_test) ZeroDivisionError: division by zero

MariasStory commented 5 years ago

Hi @saeed-anwar, can you please describe how to setup a new (minimal) ubuntu environment in order to reproduce your results? Maybe you can recommend/test a docker image that will work with your script?

MariasStory commented 5 years ago

Hi @saeed-anwar, 1) I got your model running on "floydhub/pytorch:0.4.1-py3.39" docker image with "--cpu" option. 2) The result from my test image, taken with webcam, shows that the webcam noise is removed by running the model twice. 3) Can I modify strength of the noise removal by your model?

nelaturuharsha commented 4 years ago

I am facing this issue with PyTorch 0.4.1 --> how could I fix this?

kmuw commented 2 years ago

This error can be fixed by replacing all instances of misc.imread and misc.imwrite with imageio.imread and imageio.imwrite, respectively. And adding import imageio to all affected files.

As an explanation: the author most likely used scipy <= v1.2.0 after which imread/write was removed (see https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imread.html)