Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
9d7bf4ea
Unverified
Commit
9d7bf4ea
authored
Dec 14, 2020
by
xiang song(charlie.song)
Committed by
GitHub
Dec 14, 2020
Browse files
Fix citation data loading (#2421)
Co-authored-by:
Ubuntu
<
ubuntu@ip-172-31-57-25.ec2.internal
>
parent
0ceb6751
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
python/dgl/data/citation_graph.py
python/dgl/data/citation_graph.py
+9
-7
python/dgl/data/dgl_dataset.py
python/dgl/data/dgl_dataset.py
+2
-0
No files found.
python/dgl/data/citation_graph.py
View file @
9d7bf4ea
...
@@ -171,13 +171,15 @@ class CitationGraphDataset(DGLBuiltinDataset):
...
@@ -171,13 +171,15 @@ class CitationGraphDataset(DGLBuiltinDataset):
graphs
,
_
=
load_graphs
(
str
(
graph_path
))
graphs
,
_
=
load_graphs
(
str
(
graph_path
))
info
=
load_info
(
str
(
info_path
))
info
=
load_info
(
str
(
info_path
))
self
.
_g
=
graphs
[
0
]
graph
=
graphs
[
0
]
self
.
_g
=
graph
# for compatability
graph
=
graph
.
clone
()
graph
=
graph
.
clone
()
graph
.
pop
(
'train_mask'
)
graph
.
ndata
.
pop
(
'train_mask'
)
graph
.
pop
(
'val_mask'
)
graph
.
ndata
.
pop
(
'val_mask'
)
graph
.
pop
(
'test_mask'
)
graph
.
ndata
.
pop
(
'test_mask'
)
graph
.
pop
(
'feat'
)
graph
.
ndata
.
pop
(
'feat'
)
graph
.
pop
(
'label'
)
graph
.
ndata
.
pop
(
'label'
)
graph
=
to_networkx
(
graph
)
graph
=
to_networkx
(
graph
)
self
.
_graph
=
nx
.
DiGraph
(
graph
)
self
.
_graph
=
nx
.
DiGraph
(
graph
)
...
@@ -328,7 +330,7 @@ class CoraGraphDataset(CitationGraphDataset):
...
@@ -328,7 +330,7 @@ class CoraGraphDataset(CitationGraphDataset):
- Number of Classes: 7
- Number of Classes: 7
- Label split:
- Label split:
- Train: 140
- Train: 140
- Valid: 500
- Valid: 500
- Test: 1000
- Test: 1000
...
...
python/dgl/data/dgl_dataset.py
View file @
9d7bf4ea
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
from
__future__
import
absolute_import
from
__future__
import
absolute_import
import
os
,
sys
,
hashlib
import
os
,
sys
,
hashlib
import
traceback
import
abc
import
abc
from
.utils
import
download
,
extract_archive
,
get_download_dir
,
makedirs
from
.utils
import
download
,
extract_archive
,
get_download_dir
,
makedirs
from
..utils
import
retry_method_with_fix
from
..utils
import
retry_method_with_fix
...
@@ -170,6 +171,7 @@ class DGLDataset(object):
...
@@ -170,6 +171,7 @@ class DGLDataset(object):
except
:
except
:
load_flag
=
False
load_flag
=
False
if
self
.
verbose
:
if
self
.
verbose
:
print
(
traceback
.
format_exc
())
print
(
'Loading from cache failed, re-processing.'
)
print
(
'Loading from cache failed, re-processing.'
)
if
not
load_flag
:
if
not
load_flag
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment