graph_sage example code
See original GitHub issue❓ Questions & Help
Hello, when I run the graph_sage example code (copy from pytorch_geometric/examples/graph_sage_unsup.py
), somthing goes wrong, may I ask if this is caused by a version problem?
Traceback (most recent call last):
File "/home/yf/code/gnn_explainer/examples/graphsage_Cora.py", line 117, in <module>
loss = train()
File "/home/yf/code/gnn_explainer/examples/graphsage_Cora.py", line 83, in train
for batch_size, n_id, adjs in train_loader:
File "/home/yf/app/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 345, in __next__
data = self._next_data()
File "/home/yf/app/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/yf/app/anaconda3/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/home/yf/code/gnn_explainer/examples/graphsage_Cora.py", line 38, in sample
return super(NeighborSampler, self).sample(batch)
File "/home/yf/app/anaconda3/lib/python3.6/site-packages/torch_geometric/data/sampler.py", line 109, in sample
adj, n_id = self.adj.sample_adj(n_id, size, replace=False)
AttributeError: 'SparseTensor' object has no attribute 'sample_adj'
Versions
python: 3.6.6
pytorch: 1.4.0
cuda: 10.0
torch_sparse: 0.6.1
torch_geometric: 1.6.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
GraphSAGE for Classification in Python | Well Enough
GraphSAGE is an inductive graph neural network capable of representing and classifying previously unseen nodes with high accuracy.
Read more >Introduction to GraphSAGE in Python - Towards Data Science
GraphSAGE is a Graph Neural Network designed to manage billions of nodes and edges thanks to neighbor sampling and a fast aggregator.
Read more >GraphSage: Representation Learning on Large Graphs - GitHub
This directory contains code necessary to run the GraphSage algorithm. GraphSage can be viewed as a stochastic generalization of graph convolutions, ...
Read more >GraphSAGE on the CORA citation network - StellarGraph
Stellargraph example: GraphSAGE on the CORA citation network¶. Run the master version of this notebook: Import stellargraph: [1]:.
Read more >GraphSAGE - SNAP: Stanford
Motivation; Code; Datasets; Contributors; References ... To run GraphSAGE, it needs to train on an example graph or set of graphs. After training,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see. What happens if you remove the
@torch.jit.script
annotations intorch_sparse/storage.py
andtorch_sparse/tensor.py
? Removing this should lead to backward compatibility.Thanks again for your help, but unfortunately another problem appeared when I replace
row = idx // num_cols
withrow = idx / num_cols
(no other changes) and runimport torch_sparse