Comments (13)
This makes sense, and we should add an assertion to prevent this. The NeighborSampler
is a CPU-op, and hence expects data
being on the CPU.
from pytorch_cluster.
Can you test if the test suite of torch-cluster
works for you?
from pytorch_cluster.
Can you test if the test suite of
torch-cluster
works for you?
I just run python setup.py install
and then python setup.py test
, all tests passed.
test/test_fps.py ....
test/test_graclus.py ............................
test/test_grid.py ........................................................
test/test_knn.py ........
test/test_nearest.py ....
test/test_radius.py ........
test/test_rw.py ..
test/test_sampler.py .
----------- coverage: platform linux, python 3.6.8-final-0 -----------
Name Stmts Miss Cover
-----------------------------------------------
torch_cluster/__init__.py 10 0 100%
torch_cluster/fps.py 10 0 100%
torch_cluster/graclus.py 10 0 100%
torch_cluster/grid.py 9 0 100%
torch_cluster/knn.py 37 0 100%
torch_cluster/nearest.py 21 0 100%
torch_cluster/radius.py 31 0 100%
torch_cluster/rw.py 11 0 100%
torch_cluster/sampler.py 8 0 100%
-----------------------------------------------
TOTAL 147 0 100%
============================= 111 passed in 24.19s =============================
from pytorch_cluster.
Okay, I did not expect this. So installation succeed. The reddit.py
example works for me, so I am not sure what may causes this issue. Is it possible to do some debugging on your side?
from pytorch_cluster.
I am also facing the same issue.
My graph has 643474
nodes and 1222204
edges.
I am trying to use NeighborSampler
to generate batches of size 128
. I tried using full neighborhood (size=1.0) as well as subsampling (e.g. size=16).
In both cases, the code terminates with Segmentation Fault
at this line of pytorch_cluster/torch_cluster/sampler.py
file.
The example code reddit.py
from Pytorch Geometric works fine for me.
from pytorch_cluster.
Can you send me your data.edge_index
per mail? Curious to debug this!
from pytorch_cluster.
My code terminates with Segmentation Fault
at this line too when I run python reddit.py
from pytorch_cluster.
Can you send me your
data.edge_index
per mail? Curious to debug this!
@rusty1s, I shared the data.edge_index file over email.
Thank you for looking into this issue.
from pytorch_cluster.
I received your file and will look into it. An initial guess is that it may be due to isolated nodes.
from pytorch_cluster.
I thought that too.
I did try adding the self-loops to avoid zero-degree nodes, but it wasn't enough to avoid the error.
from pytorch_cluster.
Works flawless for me:
import torch
from torch_geometric.read import read_txt_array
from torch_geometric.data import Data
from torch_geometric.data import NeighborSampler
edge_index = read_txt_array('edge_indices.txt', sep=' ', dtype=torch.long)
edge_index = edge_index.t().contiguous()
data = Data(edge_index=edge_index)
print(data)
loader = NeighborSampler(data, size=1.0, num_hops=2, batch_size=100,
shuffle=False, add_self_loops=False)
for data_flow in loader():
print(data_flow)
Can you run the code and see if it works for you?
from pytorch_cluster.
This code works.
The problem happens when either edge_index
or data
object or both are in GPU memory.
import torch
from torch_geometric.read import read_txt_array
from torch_geometric.data import Data
from torch_geometric.data import NeighborSampler
# Put edge_index in GPU memory
edge_index = read_txt_array('edge_indices.txt', sep=' ', dtype=torch.long).cuda()
edge_index = edge_index.t().contiguous()
# Put data object to GPU memory
data = Data(edge_index=edge_index).to('cuda')
print(data)
loader = NeighborSampler(data, size=1.0, num_hops=2, batch_size=100,
shuffle=False, add_self_loops=False)
for data_flow in loader():
print(data_flow)
Output:
torch_geometric/data/data.py:177: UserWarning: The number of nodes in your data object can only be inferred by its edge indices, and hence may result in unexpected batch-wise behavior, e.g., in case there exists isolated nodes. Please consider explicitly setting the number of nodes for this data object by assigning it to data.num_nodes.
warnings.warn(__num_nodes_warn_msg__.format('edge'))
Segmentation fault (core dumped)
from pytorch_cluster.
This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?
from pytorch_cluster.
Related Issues (20)
- CUDA 12.1 binaries HOT 3
- documentation HOT 2
- No such operator torch_cluster::fps_ptr_list HOT 2
- random_walk result not reproducible if the walk is biased HOT 8
- How to run fps algorithm in editable mode? HOT 2
- Binaries for PPC (ppc64le) architecture. HOT 1
- How to install pytorch_cluster in a win10 based system HOT 2
- can k >100 in knn? HOT 2
- warning when work with torch.compile HOT 2
- RuntimeError: Not compiled with CUDA support,help please.my torch is 2.1.0 and my cuda is 12.0. HOT 3
- Conda installation wants to downgrade to PyTorch 1.12.1 HOT 3
- Still there: Incompatibility with bfloat16 HOT 4
- setup.py depends on `torch` HOT 4
- Torch cluster fails to install correctly on latest GH actions runner image HOT 5
- Unable to pip install torch-cluster HOT 2
- [Installation/Compiling] Building wheel for torch-cluster failed for CUDA 12.1 HOT 2
- Simplify build wheels github workflow pipeline
- Err: source code compile HOT 3
- Missing `omp.h` error HOT 1
- ARM64 torch_cluster.radius bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch_cluster.