yiranran / APDrawingGAN

Code for APDrawingGAN: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs (CVPR 2019 Oral)
Apache License 2.0
785 stars 145 forks source link

How to use CPU to run the test.py? #23

Closed wujoho closed 1 year ago

wujoho commented 1 year ago

Can I run test.py using CPU instead of GPU please?

Currently when run:

python test.py --dataroot dataset/data/test_single --name formal_author --model test --dataset_mode single --norm batch 
--use_local --which_epoch 300

got error:

Traceback (most recent call last): File "test.py", line 10, in opt = TestOptions().parse() File "C:\repos\zzz\APDrawingGAN\options\base_options.py", line 131, in parse torch.cuda.set_device(opt.gpu_ids[0]) File "C:\repos\zzz\APDrawingGAN\venv\lib\site-packages\torch\cuda__init__.py", line 314, in set_device torch._C._cuda_setDevice(device) AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

wujoho commented 1 year ago

found it, need to put --gpu_ids -1 in the command, thanks