caiyuanhao1998 / Retinexformer

"Retinexformer: One-stage Retinex-based Transformer for Low-light Image Enhancement" (ICCV 2023) & (NTIRE 2024 Challenge)
https://arxiv.org/abs/2303.06705
MIT License
832 stars 65 forks source link

RuntimeWarning: Mean of empty slice. #10

Closed shangyueweiliang closed 11 months ago

shangyueweiliang commented 11 months ago

export CUDA_VISIBLE_DEVICES=0 dataset LOL_v1 ===>Testing using weights: /home/cy/Retinexformer/Retinexformer-master/pretrained_weights/pretrain_model/LOL_v1.pth data/LOLv1/Test/input data/LOLv1/Test/target 0it [00:00, ?it/s] /home/cy/anaconda3/envs/Retinexformer/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3441: RuntimeWarning: Mean of empty slice. out=out, **kwargs) /home/cy/anaconda3/envs/Retinexformer/lib/python3.7/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) PSNR: nan SSIM: nan

So,what should i do?thank you

caiyuanhao1998 commented 11 months ago

For RuntimeWarning: Mean of empty slice , you are calling the mean function on an empty slice, i.e., you are asking for the mean no values at some point in your program.

Please insert some breakpoints in your program to have a check.

I guess you may mistaken some paths

nameOfjinshuai commented 8 months ago

我也遇到了这个问题,现在已经解决了。我的原因在于lol数据集的存放目录不正确。 LOLv1应该存放在Retinexformer-master的data目录下(即需要自己先在Retinexformer-master下创建一个data目录),而不是存放在basicsr的data目录下。

如图所示: 截屏2023-12-28 15 20 06

chaoyue12345678 commented 8 months ago

我也遇到了这个问题,现在已经解决了。我的原因在于lol数据集的存放目录不正确。 LOLv1应该存放在Retinexformer-master的data目录下(即需要自己先在Retinexformer-master下创建一个data目录),而不是存放在basicsr的data目录下。

如图所示: 截屏2023-12-28 15 20 06

可以看一下你的数据集放哪里了 和你的测试代码吗 看哪里不合适

SaadAhmad376 commented 1 month ago

I am having the same issue even though my paths are correct. BTW I'm trying it for NTIRE.

chaoyue12345678 commented 1 month ago

谢谢

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2024年7月26日(星期五) 晚上7:59 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [caiyuanhao1998/Retinexformer] RuntimeWarning: Mean of empty slice. (Issue #10)

I am having the same issue even though my paths are correct. BTW I'm trying it for NTIRE.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>