Git Product home page Git Product logo

Comments (19)

sjmoran avatar sjmoran commented on August 21, 2024

Thank you for your interest in this work. It should be possible to run on CPU, although it might be quite slow. The calls that you have made i.e. remove net.cuda() and loading onto the cpu would have been my suggestion, but they appear not to have worked for you. Can you provide more detail please on the batch size 0 issue? Does this mean you getting back no data from the data loader?

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

Sure, The error is that one:
2022-02-09 14:19:26,374 INFO ##############################
2022-02-09 14:19:26,374 INFO Loading Adobe5k dataset ...
/home/francescadigiacomo/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py:478: UserWarning: This DataLoader will create 10 worker processes in total. Our suggested max number of worker in current system is 8, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
warnings.warn(_create_warning_msg(
2022-02-09 14:19:26,375 INFO Performing inference with images in directory: ./adobe5k_dpe/
0
0
Traceback (most recent call last):
File "main.py", line 352, in
main()
File "main.py", line 128, in main
inference_evaluator.evaluate(net, epoch=0)
File "path/CURL/metric.py", line 153, in evaluate
psnr_avg = psnr_avg / num_batches
ZeroDivisionError: float division by zero

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

I don't think this is an issue with running on the CPU. I believe it is to do with the structure of the inference directory. Can you please show the directory structure you have.

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

5c70bbb3-a420-4e92-bac2-eba9790810be

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

Screenshot from 2022-02-09 14-29-28

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

Thanks, can you also share the command you enter at the command line?

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

python3 main.py --inference_img_dirpath=./adobe5k_dpe/ --checkpoint_filepath=./pretrained_models/adobe_dpe/curl_validpsnr_23.073045286204017_validloss_0.0701291635632515_testpsnr_23.584083321292365_testloss_0.061363041400909424_epoch_510_model.pt

the difference with your suggestion is :/pretrained_models/adobe_dpe, because from git clone there are not the models inside pretrained_models

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

Got it, so I suspect I know the problem here. The code will look in curl_example_test_input for the images. It does this as in line 298 of data.py it is looking for a directory with "input" in the name - see here. The images listed in images_inference.txt are not those in curl_example_test_input. To get this to work you should add into images_inference.txt those image file names that are in curl_example_test_input, removing the extensions.

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

Good, I will try you suggestions, thank you so much. Another questions, please. From you point of view, is it possible to use your model and apply them with a cpp implementation? Do you know if could be some issue moving from python to cpp for your implementation?

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

Sorry, I followed your suggestion but it seems to not work with the same result
image
image
image

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

Change this to img_id = file.split(".")[0]

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

Thank you so much, but another problem occurred:
image
image
What do you think can be the issue?

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

What is the contents of img_filepath? Try and print it out to debug: print(img_filepath)

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

image
it seems correct, but it returns the same issue

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

input_img_filepath has no root directory or path attached to it, so the loading function is unable to find the image

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

Good, I will try you suggestions, thank you so much. Another questions, please. From you point of view, is it possible to use your model and apply them with a cpp implementation? Do you know if could be some issue moving from python to cpp for your implementation?

Yes, my suggested approach is to compile the model to Onnx and that will allow you to inference it from a cpp application. More detail here.

from curl.

FrancescaCi avatar FrancescaCi commented on August 21, 2024

Hi,
thank you so much for your suggestions about Cpp implementation, for the path problem, I tried this command, forcing the directory from the command but it is not able to find the image, where can I include the directory?
python3 main.py --inference_img_dirpath=/home/francescadigiacomo/inventia-image-tools/TEST_IMAGE_ENHANCEMENT/linux_inventia/CURL/adobe5k_dpe/ --checkpoint_filepath=/home/francescadigiacomo/inventia-image-tools/TEST_IMAGE_ENHANCEMENT/linux_inventia/CURL/pretrained_models/curl_validpsnr_23.073045286204017_validloss_0.0701291635632515_testpsnr_23.584083321292365_testloss_0.061363041400909424_epoch_510_model.pt

image

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

I will need a little more debug info from you to help. What are the contents of this?

from curl.

sjmoran avatar sjmoran commented on August 21, 2024

Closing due to inactivity

from curl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.