After training using transformer, calling model.save_pretrained(path)
trigger this error in Vertex AI Deep Learning VM. I’m using NVIDIA L4 instances and Jupyter Notebook.
This problem is not because transformers version after I tried several version.

This error happen because the model still in cuda
GPU memory. To fix it, move the model to CPU
first.
model.to('cpu')
model.save_pretrained('path')