skchen1993 / 2023_CEVR

ICCV 2023: Learning Continuous Exposure Value Representations for Single-Image HDR Reconstruction
13 stars 2 forks source link

RuntimeWarning: invalid value encountered in scalar divide (NAN for PSNR and SSIM) #1

Open zhwhong opened 4 months ago

zhwhong commented 4 months ago

When I run the code, I got 'RuntimeWarning: invalid value encountered in scalar divide', and all score (avg PSNR, SSIM, MS-SSIM .etc) is NAN. Is there anything I missed ?

!!!!!!!!!!inference on 256*256 Initializing with device: cuda scene_fold: [] Generating Floating EV stack1 Dataset info preparation!! exp_result folder: ./train_strategy/experiment/CEVR_NormNoAffine_Maps_GN_Dmodel/exp_result_VDS_epochbest/ existed! normal model !!!! net_name = CEVR_NormNoAffine_Maps !!!! CEVR(Maps) Normalization layer affine: False /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead. warnings.warn( /home/xxx/anaconda3/envs/xxxlib/python3.9/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=VGG16_BN_Weights.IMAGENET1K_V1. You can also use weights=VGG16_BN_Weights.DEFAULT to get the most up-to-date weights. warnings.warn(msg) BottleNeck normlization don't use affine(Learnable parameter) #############################self.norm_type in bottleneck: GroupNorm #################### Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic model_name: CEVR_NormNoAffine_Maps pretrain: vgg mlp_num: 3 decoder: mult_resizeUp_map activation: leaky_relu !!!! net_name = CEVR_NormNoAffine_Maps !!!! CEVR(Maps) Normalization layer affine: False BottleNeck normlization don't use affine(Learnable parameter) #############################self.norm_type in bottleneck: GroupNorm #################### Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic model_name: CEVR_NormNoAffine_Maps pretrain: vgg mlp_num: 3 decoder: mult_resizeUp_map activation: leaky_relu Model build up and load weight successfully!! Weight name: model_best.pth /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/numpy/core/_methods.py:206: RuntimeWarning: Degrees of freedom <= 0 for slice ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof, /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/numpy/core/_methods.py:163: RuntimeWarning: invalid value encountered in divide arrmean = um.true_divide(arrmean, div, out=arrmean, /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/numpy/core/_methods.py:198: RuntimeWarning: invalid value encountered in scalar divide ret = ret.dtype.type(ret / rcount) /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3504: RuntimeWarning: Mean of empty slice. return _methods._mean(a, axis=axis, dtype=dtype, /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide ret = ret.dtype.type(ret / rcount) EV -3 avg PSNR: 0 , std: nan , avg SSIM: nan , std: nan svg MS-SSIM: nan , std: nan EV -2 avg PSNR: 0 , std: nan , avg SSIM: nan , std: nan svg MS-SSIM: nan , std: nan EV -1 avg PSNR: 0 , std: nan , avg SSIM: nan , std: nan svg MS-SSIM: nan , std: nan EV 1 avg PSNR: 0 , std: nan , avg SSIM: nan , std: nan svg MS-SSIM: nan , std: nan EV 2 avg PSNR: 0 , std: nan , avg SSIM: nan , std: nan svg MS-SSIM: nan , std: nan EV 3 avg PSNR: 0 , std: nan , avg SSIM: nan , std: nan svg MS-SSIM: nan , std: nan

Note: The pth file in 'train_strategy/experiment/CEVR_NormNoAffine_Maps_GN_Bmodel/inc' should be model_best.pth, not 'final_model.pth'

!!!!!!!!!!inference on 256*256 Initializing with device: cuda scene_fold: [] Generating Floating EV stack1 Dataset info preparation!! exp_result folder: ./train_strategy/experiment/CEVR_NormNoAffine_Maps_GN_Dmodel/exp_result_VDS_epochbest/ existed! normal model !!!! net_name = CEVR_NormNoAffine_Maps !!!! CEVR(Maps) Normalization layer affine: False /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead. warnings.warn( /home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=VGG16_BN_Weights.IMAGENET1K_V1. You can also use weights=VGG16_BN_Weights.DEFAULT to get the most up-to-date weights. warnings.warn(msg) BottleNeck normlization don't use affine(Learnable parameter) #############################self.norm_type in bottleneck: GroupNorm #################### Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic model_name: CEVR_NormNoAffine_Maps pretrain: vgg mlp_num: 3 decoder: mult_resizeUp_map activation: leaky_relu !!!! net_name = CEVR_NormNoAffine_Maps !!!! CEVR(Maps) Normalization layer affine: False BottleNeck normlization don't use affine(Learnable parameter) #############################self.norm_type in bottleneck: GroupNorm #################### Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic Decoder normlization don't use affine(Learnable parameter) #############################self.norm_type in DecoderBlock(Maps): GroupNorm #################### Resize_conv upsample mode: bicubic model_name: CEVR_NormNoAffine_Maps pretrain: vgg mlp_num: 3 decoder: mult_resizeUp_map activation: leaky_relu Traceback (most recent call last): File "/home/xxx/2023_CEVR/demo_VDS.py", line 154, in model_inc.load_state_dict(torch.load(B_path + 'inc/' + weight_name)) File "/home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/torch/serialization.py", line 771, in load with _open_file_like(f, 'rb') as opened_file: File "/home/zwhong/anaconda3/envs/xxx/lib/python3.9/site-packages/torch/serialization.py", line 270, in _open_file_like return _open_file(name_or_buffer, mode) File "/home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/torch/serialization.py", line 251, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: './train_strategy/experiment/CEVR_NormNoAffine_Maps_GN_Bmodel/inc/model_best.pth'