I am getting the following error when I try to run train_singlegpu_demo.sh
File "/home/mayank/Projects/finetune-SAM/SingleGPU_train_finetune_noprompt.py", line 212, in
train_model(trainloader,valloader,args.dir_checkpoint,args.epochs)
File "/home/mayank/Projects/finetune-SAM/SingleGPU_train_finetune_noprompt.py", line 51, in train_model
sam = sam_model_registryargs.arch
File "/home/mayank/Projects/finetune-SAM/models/sam/build_sam.py", line 49, in build_sam_vit_b
return _build_sam(
File "/home/mayank/Projects/finetune-SAM/models/sam/build_sam.py", line 140, in _build_sam
image_encoder=ImageEncoderViT(
File "/home/mayank/Projects/finetune-SAM/models/sam/modeling/image_encoder.py", line 82, in init
torch.zeros(1, img_size // patch_size, img_size // patch_size, embed_dim,dtype=torch.float, device=self.dev[0]))
File "/home/mayank/anaconda3/envs/finetune-SAM/lib/python3.10/site-packages/torch/cuda/init.py", line 293, in _lazy_init
torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available
I have two GPUs on the machine and torch.cuda.is_available outputs True. How do I fix this error?
Hi, sorry for the confusion. in the train_singlegpu_demo.sh; i choose gpu ID 5 as only visiable gpu on our machine. For your case, you need to change CUDA_VISIBLE_DEVICES= '0' or '1' or '0,1'
I am getting the following error when I try to run train_singlegpu_demo.sh
File "/home/mayank/Projects/finetune-SAM/SingleGPU_train_finetune_noprompt.py", line 212, in
train_model(trainloader,valloader,args.dir_checkpoint,args.epochs)
File "/home/mayank/Projects/finetune-SAM/SingleGPU_train_finetune_noprompt.py", line 51, in train_model
sam = sam_model_registryargs.arch
File "/home/mayank/Projects/finetune-SAM/models/sam/build_sam.py", line 49, in build_sam_vit_b
return _build_sam(
File "/home/mayank/Projects/finetune-SAM/models/sam/build_sam.py", line 140, in _build_sam
image_encoder=ImageEncoderViT(
File "/home/mayank/Projects/finetune-SAM/models/sam/modeling/image_encoder.py", line 82, in init
torch.zeros(1, img_size // patch_size, img_size // patch_size, embed_dim,dtype=torch.float, device=self.dev[0]))
File "/home/mayank/anaconda3/envs/finetune-SAM/lib/python3.10/site-packages/torch/cuda/init.py", line 293, in _lazy_init
torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available
I have two GPUs on the machine and torch.cuda.is_available outputs True. How do I fix this error?