Categories
Google Cloud

Fix Google Cloud Vertex AI Attempted to access the data pointer on an invalid python storage.

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')

Leave a Reply

Your email address will not be published. Required fields are marked *