How to carry out validation loop on one single GPU #12721
-
I have 8 gpus and during validation loop, I would like to only inference using one single GPU. I tried looking up documentation but I don't see any examples. Thanks! Environment:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
that is not possible. but if you are calling Trainer(devices=1)
trainer.validate(...) |
Beta Was this translation helpful? Give feedback.
-
I actually found a hack where by I extend the same list of files by num_of_gpus ORIGINAL FILES LIST = [1.JPG, 2.JPG,3.JPG,4.JPG] File list that GPU_0 receives = [1.JPG, 3.JPG] After the hack: File list that GPU_0 receives = [1.JPG, 2.JPG,3.JPG,4.JPG] so the distributed sampler will distribute each replica exactly once to each gpu |
Beta Was this translation helpful? Give feedback.
that is not possible.
but if you are calling
.validate
then you can configure your Trainer with devices=1