Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroDivisionError: division by zero #24

Open
JamesYu0228 opened this issue Feb 22, 2023 · 1 comment
Open

ZeroDivisionError: division by zero #24

JamesYu0228 opened this issue Feb 22, 2023 · 1 comment

Comments

@JamesYu0228
Copy link

There is something went wrong with current code in branch master.
Is there anyone who can help me solve this problem.
Thank you very much.

  1. hardwares
CPU: i7-6700K
GPU: GTX1070
  1. vendors
> conda list
# packages in environment at C:\ProgramData\Anaconda3\envs\pytorch:
#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl
ca-certificates           2023.01.10           haa95532_0
certifi                   2022.12.7        py37haa95532_0
cffi                      1.15.1           py37h2bbff1b_3
colorama                  0.4.6                    pypi_0    pypi
coqpit                    0.0.17                   pypi_0    pypi
cuda90                    1.0                           0    pytorch
cycler                    0.11.0                   pypi_0    pypi
fonttools                 4.38.0                   pypi_0    pypi
freetype                  2.12.1               ha860e81_0
fsspec                    2023.1.0                 pypi_0    pypi
imageio                   2.25.0                   pypi_0    pypi
intel-openmp              2021.4.0          haa95532_3556
jpeg                      9e                   h2bbff1b_0
kiwisolver                1.4.4                    pypi_0    pypi
lerc                      3.0                  hd77b12b_0
libdeflate                1.8                  h2bbff1b_5
libpng                    1.6.37               h2a8f88b_0
libtiff                   4.5.0                h6c2663c_1
libwebp                   1.2.4                h2bbff1b_0
libwebp-base              1.2.4                h2bbff1b_0
lz4-c                     1.9.4                h2bbff1b_0
matplotlib                3.5.3                    pypi_0    pypi
mkl                       2021.4.0           haa95532_640
mkl-service               2.4.0            py37h2bbff1b_0
mkl_fft                   1.3.1            py37h277e83a_0
mkl_random                1.2.2            py37hf11a4ad_0
networkx                  2.6.3                    pypi_0    pypi
numpy                     1.21.5           py37h7a0a035_3
numpy-base                1.21.5           py37hca35cd5_3
openssl                   1.1.1s               h2bbff1b_0
packaging                 23.0                     pypi_0    pypi
pillow                    9.3.0            py37hd77b12b_2
pip                       22.3.1           py37haa95532_0
protobuf                  3.19.6                   pypi_0    pypi
psutil                    5.9.4                    pypi_0    pypi
pycparser                 2.21               pyhd3eb1b0_0
pyparsing                 3.0.9                    pypi_0    pypi
python                    3.7.16               h6244533_0
python-dateutil           2.8.2                    pypi_0    pypi
pytorch                   0.4.1           py37_cuda90_cudnn7he774522_1    pytorch
pywavelets                1.3.0                    pypi_0    pypi
scikit-image              0.19.3                   pypi_0    pypi
scipy                     1.7.3                    pypi_0    pypi
setuptools                65.6.3           py37haa95532_0
six                       1.16.0             pyhd3eb1b0_1
soundfile                 0.11.0                   pypi_0    pypi
sqlite                    3.40.1               h2bbff1b_0
tensorboardx              2.5.1                    pypi_0    pypi
tifffile                  2021.11.2                pypi_0    pypi
tk                        8.6.12               h2bbff1b_0
torch                     1.13.1                   pypi_0    pypi
torchvision               0.2.1                      py_2    pytorch
tqdm                      4.64.1                   pypi_0    pypi
trainer                   0.0.22                   pypi_0    pypi
typing-extensions         4.4.0                    pypi_0    pypi
utility                   1.0                      pypi_0    pypi
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wheel                     0.37.1             pyhd3eb1b0_0
wincertstore              0.2              py37haa95532_2
xz                        5.2.10               h8cc25b3_1
zlib                      1.2.13               h8cc25b3_0
zstd                      1.5.2                h19a0ad4_0
  1. exec commands
> python main.py --data_test MyImage --noise_g 1 --model RIDNET --n_feats 64 --pre_train ../experiment/ridnet.pt --test_only --save_results --save RIDNET_RNI15 --testpath ../LR/LRBI/ --testset RNI15
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 "D:\scripts\python\RIDNet\TestCode\code\trainer.py", line 139, in terminate
    self.test()
  File "D:\scripts\python\RIDNet\TestCode\code\trainer.py", line 110, in test
    self.ckp.log[-1, idx_scale] = eval_acc / len(self.loader_test)
ZeroDivisionError: division by zero
  1. Code snippets
    trainer.py:110
self.ckp.log[-1, idx_scale] = eval_acc / len(self.loader_test)
@bairuihan
Copy link

Have you solved your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants