Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dgl.__version__ >= 0.8 breaks on partition.py #269

Closed
lroberts7 opened this issue Dec 7, 2022 · 2 comments
Closed

dgl.__version__ >= 0.8 breaks on partition.py #269

lroberts7 opened this issue Dec 7, 2022 · 2 comments

Comments

@lroberts7
Copy link
Contributor

I noted this in a comment:
https://github.com/awslabs/dgl-ke/pull/268/files#diff-6fa7773ef2017429e0385fdbff10e2c9b5021e282a503eb7e47eeb93f651eb18

The version upgrade in dgl
#268
caused the dgl.transform method in partition.py to raise an error here:

part_dict = dgl.transform.metis_partition(g, num_parts, 1)

if the environment has a morerecent version of dgl.

Dgl version 0.8 changed the name to transforms (added an s) -> https://github.com/dmlc/dgl/releases/tag/0.8.0

A fix would be to add an if/else block based on the dgl version and call either attribute. I used the search box in github to search this repository and this appears to be the only use of the dgl.transform

@lroberts7
Copy link
Contributor Author

lroberts7 commented Dec 7, 2022

Note there aren't any unit tests on this as it's a simple call out to dgl but if there are suggestions around adding a unit test please let me know. Also here is a stacktrace of the issue:

$ dglke_partition -k 1 --data_path '/Users/lroberts/datascience/dgl/dgl-ke/data/codebase'
load dataset..
Reading train triples....
Finished. Read 483142 train triples.
Reading valid triples....
Finished. Read 50000 valid triples.
Reading test triples....
Finished. Read 59071 test triples.
construct graph...
/opt/homebrew/lib/python3.10/site-packages/dgl/_deprecate/graph.py:1023: DGLWarning: multigraph will be deprecated.DGL will treat all graphs as multigraph in the future.
  dgl_warning("multigraph will be deprecated." \
partition graph...
Traceback (most recent call last):
  File "/opt/homebrew/bin/dglke_partition", line 33, in <module>
    sys.exit(load_entry_point('dglke==0.1.0.dev0', 'console_scripts', 'dglke_partition')())
  File "/opt/homebrew/lib/python3.10/site-packages/dglke-0.1.0.dev0-py3.10.egg/dglke/partition.py", line 119, in main
AttributeError: module 'dgl' has no attribute 'transform'. Did you mean: 'transforms'?

$ python3
Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import dgl
print(dgl.version)
0.9.1

@lroberts7
Copy link
Contributor Author

closed via -> #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant