Closed olegkorshunov closed 2 years ago
I would leave the code as is and simply run the script with CUDA_VISIBLE_DEVICES=2
I would leave the code as is and simply run the script with CUDA_VISIBLE_DEVICES=2 I am not sure, mb I doing smhng wrong, I try it command
!CUDA_VISIBLE_DEVICES=2, python scripts/inference.py \ --exp_dir=./experiment \ --checkpoint_path=./pretrained_models/psp_ffhq_toonify.pt \ --data_path=./photo_crops \ --test_batch_size=2 \ --test_workers=2 \ --couple_outputs
and got this error
Loading pSp from checkpoint: ./pretrained_models/psp_ffhq_toonify.pt Traceback (most recent call last): File "scripts/inference.py", line 169, in <module> run() File "scripts/inference.py", line 56, in run net = pSp(opts) File "/home/uadmin/Projects/gan/pixel2style2pixel/./models/psp.py", line 34, in __init__ self.load_weights() File "/home/uadmin/Projects/gan/pixel2style2pixel/./models/psp.py", line 57, in load_weights self.__load_latent_avg(ckpt) File "/home/uadmin/Projects/gan/pixel2style2pixel/./models/psp.py", line 131, in __load_latent_avg self.latent_avg = ckpt["latent_avg"].to(self.opts.device) RuntimeError: CUDA error: invalid device ordinal
I would leave the code as is and simply run the script with CUDA_VISIBLE_DEVICES=2
sorry my bad I forgot I also changed the PSP, everything is working now thx :-)
I want to run inference on cuda:2, I rewrote the code like this
and in inference.py I also replaced everything
but it isn't worked, I just get a brown image, on cuda:0 everything is okey