jonasricker / diffusion-model-deepfake-detection

[VISAPP2024] Towards the Detection of Diffusion Model Deepfakes
https://arxiv.org/abs/2210.14571
MIT License
82 stars 10 forks source link

run on cpu #2

Closed mbarakovskiy closed 1 year ago

mbarakovskiy commented 1 year ago

Hello there! I have a problem running yours scripts because I have Macbook with Intel Chip so I cannot install torch with CUDA )))) So scrips falls with following error: AssertionError: Torch not compiled with CUDA enabled is there any simple way to run scripts on cpu? maybe it's very simple, but i'm new to nn and python, so i can't find easy way to do it

Thanks)

jonasricker commented 1 year ago

Hello mbarakovskiy, you are right, there is no straightforward way to run the scripts without CUDA at the moment, I will try to add this in the future. But you can use the following workaround (I assume you try to run evaluate_detector.py):

For each detector, add cuda=False to the dictionary, e.g., after this line: https://github.com/jonasricker/diffusion-model-deepfake-detection/blob/9916aa38d813d5ee5724ab92791042f8cbdda128/evaluate_detectors.py#L49

You will also have to manually specify a batch size when calling the script, e.g., --batch-size 8.

Let me know if that solves your issue!

mbarakovskiy commented 1 year ago

It worked out! Thank you for help and quick answer, Jonas!