gentlezhu / shift-robust-gnns Goto Github PK
View Code? Open in Web Editor NEW"Shift-Robust GNNs: Overcoming the Limitations of Localized Graph Training Data" (NeurIPS 21')
"Shift-Robust GNNs: Overcoming the Limitations of Localized Graph Training Data" (NeurIPS 21')
Hi,
I get the following errors when running main_gnn.py
:
Using backend: pytorch
number of classes 7
Using CUDA
Traceback (most recent call last):
File "main_gnn.py", line 729, in <module>
micro_f1, macro_f1, out_acc = main(args, [])
File "main_gnn.py", line 463, in main
args.aggregator_type
File ".../Shift-Robust-GNNs/dgl_models.py", line 254, in __init__
self.layers.append(GATConv(in_feats, n_hidden, num_heads=num_heads, feat_drop=dropout, activation=activation))
File ".../python3.7/site-packages/dgl/nn/pytorch/conv/gatconv.py", line 160, in __init__
self._in_src_feats, out_feats * num_heads, bias=False)
File ".../python3.7/site-packages/torch/nn/modules/linear.py", line 81, in __init__
self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:
* (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
* (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
and 2. GraphSAGE:
Using backend: pytorch
number of classes 7
Using CUDA
Traceback (most recent call last):
File "main_gnn.py", line 729, in <module>
micro_f1, macro_f1, out_acc = main(args, [])
File "main_gnn.py", line 544, in main
total_loss = loss + 1 * cmd(model.h[idx_train, :], model.h[iid_train, :])
File ".../python3.7/site-packages/torch/nn/modules/module.py", line 1131, in __getattr__
type(self).__name__, name))
AttributeError: 'GraphSAGE' object has no attribute 'h'
relevant packages form pip freeze
:
dgl-cu102==0.6.1
torch==1.9.0+cu102
Thanks.
Hi, your project Shift-Robust-GNNs requires "networkx==2.5" in its dependency. After analyzing the source code, we found that some other versions of networkx can also be suitable without affecting your project, i.e., networkx 2.5.1. Therefore, we suggest to loosen the dependency on networkx from "networkx==2.5" to "networkx>=2.5,<=2.5.1" to avoid any possible conflict for importing more packages or for downstream projects that may use Shift-Robust-GNNs.
May I pull a request to loosen the dependency on networkx?
By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?
For your reference, here are details in our analysis.
Your project Shift-Robust-GNNs(commit id: 28ddefd) directly uses 4 APIs from package networkx.
networkx.classes.graph.Graph.__init__, networkx.convert.from_dict_of_lists, networkx.algorithms.centrality.betweenness._single_source_shortest_path_basic, networkx.linalg.graphmatrix.adjacency_matrix
From which, 2 functions are then indirectly called, including 1 networkx's internal APIs and 1 outsider APIs, as follows (neglecting some repeated function occurrences).
[/GentleZhu/Shift-Robust-GNNs]
+--networkx.classes.graph.Graph.__init__
| +--networkx.convert.to_networkx_graph
| | +--networkx.convert.from_dict_of_dicts
| | +--networkx.convert.from_dict_of_lists
| | +--warnings.warn
| | +--networkx.convert.from_edgelist
+--networkx.convert.from_dict_of_lists
+--networkx.algorithms.centrality.betweenness._single_source_shortest_path_basic
+--networkx.linalg.graphmatrix.adjacency_matrix
We scan networkx's versions among [2.5.1] and 2.5, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).
diff: 2.5(original) 2.5.1
[](no clear difference between the source codes of two versions)
As for other packages, the APIs of @outside_package_name are called by networkx in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.
Therefore, we believe that it is quite safe to loose your dependency on networkx from "networkx==2.5" to "networkx>=2.5,<=2.5.1". This will improve the applicability of Shift-Robust-GNNs and reduce the possibility of any further dependency conflict with other projects/packages.
How to verify performance on datasets with unbiased training samples?
I would like to express my sincere appreciation for your contributions to this project. The work you've shared has been invaluable.
I'm currently delving deeper into your research and was particularly intrigued by Figure 1 presented in your paper. Could you please provide further details? If feasible, access to the related code would significantly enhance my understanding and ability to follow along with your work.
Thank you for considering my request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.