Closed mufeili closed 2 years ago
Do we see the same issue for pinned_by_dgl
as well? Or do we have an established method for handling new attributes?
Are there any plans to add a more robust system for saving/loading graph data? Relying on just serializing Python objects, like what dgl.data.utils.save_info
and dgl.data.utils.load_info
do, seems like a risky approach that may not be able to support any sort of compatibility, especially since there's no version information. I'd expect that a few data members of Column
, for example, never need to be saved or loaded, since device
, index
, and deferred_dtype
should be resolved and cleared before saving to disk, and there are probably other similar examples in other classes.
博主,您这个问题怎么解决的
Blogger, how did you solve this problem
Blogger, how did you solve this problem
For now, downgrading to 0.8.1
should address the issue.
thank you ,my problem has solved.
Hello, how can you downgrade to 0.8.1 from 0.8.2? I have a similar problem.
@natalie-0430 That will depend on how you installed it. If you used pip for example:
pip uninstall dgl-cu113
pip install dgl-cu113==0.8.1 dglgo -f https://data.dgl.ai/wheels/repo.html
@mufeili What's your preferred fix for this? Should we add hasattr
to check if the unpickled object has the new attribute, or should we override __setstate__
(https://docs.python.org/3/library/pickle.html#object.__setstate__) to explicitly populate missing attributes from old versions?
@natalie-0430 That will depend on how you installed it. If you used pip for example:
pip uninstall dgl-cu113 pip install dgl-cu113==0.8.1 dglgo -f https://data.dgl.ai/wheels/repo.html
@mufeili What's your preferred fix for this? Should we add
hasattr
to check if the unpickled object has the new attribute, or should we override__setstate__
(https://docs.python.org/3/library/pickle.html#object.__setstate__) to explicitly populate missing attributes from old versions?
@jermainewang @BarclayII What do you think? Probably overriding __setstate__
will be more general for future changes?
I vote for overriding __setstate__
and __getstate__
. Two other related questions:
DGLGraph
and Frame
.
🐛 Bug
@ndickson-nvidia @BarclayII
The introduction of
deferred_dtype
in PR #3890 seems to be causing issues when loading a graph file saved with an older version of DGL. Do you have any ideas on fixing the compatibility? We might also want to add a unit test for loading a graph data file saved with an older version of DGL.Expected behavior
Environment
conda
,pip
, source):