How to use pickle.load() lib in DGL?

I’m using pickle to save the data of my custom class A, which contains the data of the DGLGraph class. I found something strange. First, when I generated the data on my PC and used pickle.dump() and pickle.load() to save and import the data, it worked. To make it more efficient, I put all the data on another server for data generation and used pickle.dump() to save the generated data. However, when I used pickle.load() to read the generated data from the other server on the original PC, it returned an error:
AttributeError: Can't get attribute 'DGLGraph' on <module 'dgl.heterograph' from '/home/sunhy/.conda/envs/env38/lib/python3.8/site-packages/dgl/heterograph.py'>
Did I do something wrong? My dgl version is 0.9.1

I see. It is caused by the dgl version problem. dgl versions 0.9.1 and 1.0.1 behave differently in pickle lib.

Thanks for the report. We should find a way to send more clear messages. The issue is tracked here: Add versioning in pickling · Issue #5574 · dmlc/dgl · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.