sjmoran/curl-image-enhancement

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'

Closed this issue · 2 comments

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'

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

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