dmlc / dmlc/dgl

AttributeError: 'DGLGraph' object has no attribute '_use_graphbolt'

Open
#7,868 1 comment 0 reactions 0 assignees View on GitHub
stale-issue
Dominant language
Python
Stars
14.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## 🐛 Bug

I got the bug:
```
Creating minibatch pretraining dataloader...
Traceback (most recent call last):
File "/home/s12gb-2/miniconda3/envs/graph_newset/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/s12gb-2/miniconda3/envs/graph_newset/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/s12gb-2/DangNha/reset_TXGNN/TxGNN/reproduce/train.py", line 50, in
TxGNN.pretrain(n_epoch = 1,
File "/home/s12gb-2/DangNha/reset_TXGNN/TxGNN/txgnn/TxGNN.py", line 155, in pretrain
dataloader = dist.DistEdgeDataLoader(
File "/home/s12gb-2/miniconda3/envs/graph_newset/lib/python3.10/site-packages/dgl/distributed/dist_dataloader.py", line 863, in __init__
self.collator = EdgeCollator(g, eids, graph_sampler, **collator_kwargs)
File "/home/s12gb-2/miniconda3/envs/graph_newset/lib/python3.10/site-packages/dgl/distributed/dist_dataloader.py", line 634, in __init__
Collator.add_edge_attribute_to_graph(self.g, self.graph_sampler.prob)
File "/home/s12gb-2/miniconda3/envs/graph_newset/lib/python3.10/site-packages/dgl/distributed/dist_dataloader.py", line 325, in add_edge_attribute_to_graph
if g._use_graphbolt and data_name:
AttributeError: 'DGLGraph' object has no attribute '_use_graphbolt'
```
When i try to create a DistEdgeDataLoader for training. My code:
```py
import dgl
import dgl.distributed as dist
dataloader = dist.DistEdgeDataLoader(
self.G, # Graph (should be a distributed DGLGraph)
train_eid_dict, # Edge IDs (dict for heterogeneous graphs)
sampler, # Graph sampler (e.g., NeighborSampler)
negative_sampler=Minibatch_NegSampler(self.G, 1, 'fix_dst'), # For link prediction
batch_size=batch_size, # Batch size
shuffle=True, # Shuffle edges during sampling
drop_last=False, # Keep incomplete batches
# exclude='reverse_types', # Optional: for reverse edge exclusion
# reverse_etypes=reverse_etypes, # Optional: reverse edge types
num_workers=0 # Avoid multiprocessing issues (for debugging)
)
```

## My Environment

- DGL Version (e.g., 1.g.,0): dgl==2.4.0+cu121
- Backend Library & Version: Pytorch==2.4.0
- OS (e.g., Linux): Ubuntu
- How you installed DGL (`conda`, `pip`, source): pip install dgl==2.4.1 -f https://data.dgl.ai/wheels/torch-2.4/cu121/repo.html
- Python version: 3.10.16
- CUDA/cuDNN version (if applicable): 12.1

## Question
This bug is come from dgl version right, how can i solve this bug or i have to wait the new update from dgl?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.