sjmoran / CURL

Code for the ICPR 2020 paper: "CURL: Neural Curve Layers for Image Enhancement"
205 stars 34 forks source link

FileNotFoundError: [Errno 2] No such file or directory: './pretrained_models/curl_validpsnr_23.073045286204017_validloss_0.0701291635632515_testpsnr_23.584083321292365_testloss_0.061363041400909424_epoch_510_model.pt' #17

Closed BhavyaSoni31 closed 3 years ago

BhavyaSoni31 commented 3 years ago

when trying to run command described in readme for pre trained model evaluation I got this error. FileNotFoundError: [Errno 2] No such file or directory: './pretrained_models/curl_validpsnr_23.073045286204017_validloss_0.0701291635632515_testpsnr_23.584083321292365_testloss_0.061363041400909424_epoch_510_model.pt'

BhavyaSoni31 commented 3 years ago

After correcting the path I get this error :- File "main.py", line 134, in main net.eval() AttributeError: 'dict' object has no attribute 'eval'

after correcting to this net.load_state_dict(torch.load(checkpoint_filepath),strict = False) on line 133 of main.py different error thrown : Traceback (most recent call last): File "main.py", line 362, in main() File "main.py", line 141, in main inference_evaluator.evaluate(net, epoch=0) File "E:\BHAVYA\SoftmaxAI\CURL\CURL\metric.py", line 153, in evaluate psnr_avg = psnr_avg / num_batches ZeroDivisionError: float division by zero

sjmoran commented 3 years ago

Hi, the error is due to your inference directory structure. Make sure it looks like the attached screenshots and the content of the images_inference.txt are as shown.

directory_structure

images_inference file content