Can one save a locally created Spektral dataset instance?

  Kiến thức lập trình

I have locally created an instance of a custom dataset. So my question is can i save to dataset locally so that i can use it later. The dataset contains 5000 graph instances.

I have tried the following but couldn’t get it to work. Help me if someone knows the solution.

import pickle

# Save the dataset
with open('/content/drive/MyDrive/dataset.pkl', 'wb') as f:
    pickle.dump(my_dataset, f)

# Load the dataset
with open('/content/drive/MyDrive/dataset.pkl', 'rb') as f:
    loaded_dataset = pickle.load(f)

LEAVE A COMMENT