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

getting error on line line 148 in main.py #8

Closed
M-Suzy opened this issue Feb 23, 2021 · 6 comments
Closed

getting error on line line 148 in main.py #8

M-Suzy opened this issue Feb 23, 2021 · 6 comments

Comments

@M-Suzy
Copy link

M-Suzy commented Feb 23, 2021

Hi,
Could you please help to run your code without errors.
Right now I have the following issue:
2021-02-23 21:25:34,587 INFO Loading Adobe5k dataset ... Traceback (most recent call last): File "main.py", line 351, in <module> main() File "main.py", line 148, in main inference_dataset = Dataset(data_dict=inference_data_dict, NameError: name 'Dataset' is not defined

@sjmoran
Copy link
Owner

sjmoran commented Feb 23, 2021

Hi, thank you for your interest in our work. I will have updated code in a few days time, including a new pre-trained model.

@M-Suzy
Copy link
Author

M-Suzy commented Feb 23, 2021

Yes, I am using the updated commit. Here is the command I use which gives the error
python3.8 main.py --inference_img_dirpath=./adobe5k_dpe/ --checkpoint_filepath=./pretrained_models/curl_validpsnr_23.070664790618277_validloss_0.029170328751206398_testpsnr_23.556465119481636_testloss_0.02679653838276863_epoch_24_model.pt

@sjmoran
Copy link
Owner

sjmoran commented Feb 24, 2021

Issue now resolved, please see the latest code pushed to the repository today. I have also uploaded a model from epoch 99 that is more accurate (better PSNR, SSIM).

@sjmoran sjmoran closed this as completed Feb 24, 2021
@M-Suzy
Copy link
Author

M-Suzy commented Feb 24, 2021

Thank you very much for the fix! By the way, does your code support only GPU, or I can also run on CPU mode?

@sjmoran
Copy link
Owner

sjmoran commented Feb 24, 2021

Hi, CPU mode is straightforward. You just need to place the cuda keywords in the code with cpu I believe e.g. net.cuda() with net.cpu() etc. For inference you'll also need to load the model on the CPU, more information is here: https://pytorch.org/tutorials/beginner/saving_loading_models.html. Feel free to raise a PR if you have a CPU/GPU switch implemented for CURL.

@M-Suzy
Copy link
Author

M-Suzy commented Feb 24, 2021

Got it, thank you!

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