Practical overview
When it fits
Use OGB when a graph-learning experiment needs benchmark data, standardized splits and a dataset-specific evaluator, particularly when working with PyTorch Geometric or DGL.
Who it is for
- Researchers comparing graph-machine-learning methods using common datasets and evaluation protocols.
- Developers building graph-learning experiments in PyTorch Geometric or DGL.
- Teams preparing reproducible benchmark splits for node, link or graph prediction.
Documented uses
- Download and prepare benchmark graph datasets with standardized splits.
- Create training, validation and test data loaders for graph-learning experiments.
- Evaluate model predictions with metrics defined for a benchmark dataset.
- Compare methods across graph prediction tasks and dataset domains.
Requirements & limits
OGB is identified as MIT-licensed open-source software. The documented installation method is pip.
- The documented framework options are PyTorch Geometric and DGL; the requirements list either framework alongside PyTorch.
- The README requires Python 3.6 or later and PyTorch 1.6 or later, plus NumPy, pandas, urllib3, scikit-learn and outdated.
- Compute needs depend on dataset scale: small datasets may fit on one GPU, while medium and large graphs may require multiple GPUs or sampling/partitioning.
- Evaluators expect a dataset-specific input format and return the metric appropriate to that dataset.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare graph-property benchmark data with PyTorch Geometric
Download the documented ogbg-molhiv dataset and create loaders using its standardized training, validation and test splits.
Before you start
- Python 3.6 or later
- PyTorch 1.6 or later
- PyTorch Geometric 2.0.2 or later
- OGB installation via pip; the README also lists NumPy, pandas, urllib3, scikit-learn and outdated as requirements.
Steps
Install OGB with Python’s package manager: pip install ogb.
Import PygGraphPropPredDataset from ogb.graphproppred and DataLoader from torch_geometric.loader.
Create PygGraphPropPredDataset with name='ogbg-molhiv'; the example downloads and processes the dataset at ./dataset/ogbg_molhiv/.
Get the split indices with dataset.get_idx_split(), then create separate DataLoader instances for the train, valid and test indices.
Expected outcome
A downloaded and processed graph-property dataset with loaders for the standardized training, validation and test splits.
Guide limitations
- This recipe covers dataset preparation only; it does not define or train a model.
- The README notes that medium- and large-scale graphs may need multiple GPUs or sampling/partitioning techniques.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- snap-stanford/ogb · Official homepage title · retained in its source language

