Closed awsomecod closed 2 years ago
By default, from_pretrained and restore_from will restore and place the model on the GPU if no "map_location" is provided. So first it goes onto the GPU then moved to the CPU with .cpu(). You will need to use map_location="cpu" in from_pretrained.
That fixed the issue.
I run the following commands:
In the output of
nvidia-smi
, I see that800 Mb
of GPU is used when running the above commands. Why? My expectation is that no GPU memory should be used when I usecpu()
.