akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
Torch geometric radious graph

niccolot: <p>Hello, it is my first post here and i hope i’m in the right place to ask. When i try to run the example code for the <code>torch_geometric.nn</code> <code>radious_graph</code> i get an error:</p>
<pre><code class="lang-python">File "C:\Users\nico_\AppData\Local\Programs\Python\Python38\lib\site-packages\torch_geometric\nn\pool\__init__.py", line 210, in radius_graph
    return torch_cluster.radius_graph(x, r, batch, loop, max_num_neighbors,
AttributeError: 'NoneType' object has no attribute 'radius_graph'
</code></pre>
<p>the code is</p>
<pre><code class="lang-python">import torch
from torch_geometric.nn import radius_graph

x = torch.Tensor([[-1, -1], [-1, 1], [1, -1], [1, 1]])
batch = torch.tensor([0, 0, 0, 0])
edge_index = radius_graph(x, r=1.5, batch=batch, loop=False)
</code></pre>

ptrblck: <p>The error is raised by <code>torch_cluster.radius_graph</code> as <code>torch_cluster</code> is apparently set to <code>None</code>.<br>
At the top of the script you can see that <code>import torch_cluster</code> is used in a <code>try ... except</code> block <a href="https://github.com/pyg-team/pytorch_geometric/blob/fa023b338703725e2c2c33675d9c56fe3a8a9550/torch_geometric/nn/pool/__init__.py#L17-L20">here</a> and will be set to <code>None</code> if the <code>import</code> fails.<br>
Since all methods in this file seems to depend on <code>torch_cluster</code> I would expect to see an <code>ImportError</code> instead as the error message is quite misleading.<br>
CC <a class="mention" href="/u/rusty1s">@rusty1s</a></p>

niccolot: <p>I tried setting a venv in pycharm just for this project and now the problem has shifted to installing torch_cluster (same problem both for torch 1.13 and 2.0): after installing torch_geometric 2.3.0 i type the command</p>
<p><code>pip install torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cpu.html</code></p>
<p>(with the last part <code>torch-xxx+cpu.html</code> 1.13 or 2.0 when trying with torch 1.13 or 2.0, both didn’t work) it gives me this error:</p>
<pre><code class="lang-auto">Looking in links: https://data.pyg.org/whl/torch-1.13.0+cpu.html
ERROR: Could not find a version that satisfies the requirement pyg_lib (from versions: none)
ERROR: No matching distribution found for pyg_lib
</code></pre>
<p>thank you so far for the help</p>

ptrblck: <p>I just executed <code>pip install torch_cluster</code> and it built this library from source on my system.<br>
I’m not familiar with the binary/release process of PyG, so don’t know which wheels exactly are available.</p>

niccolot: <p>reinstalling everything i solved, thank you for your time, it was indeed a dependencies issue with torch cluster. Hoping this could turn useful to someone the versions are</p>
<pre><code class="lang-auto">torch -&gt; 2.0.0+cpu
torch_gemetric -&gt; 2.3.0
torch_cluster -&gt; 1.6.1+pt20cpu
python -&gt; 3.8
</code></pre>