{"id":24139,"library":"ogb","title":"Open Graph Benchmark (OGB)","description":"A library for downloading, preprocessing, and evaluating on the Open Graph Benchmark (OGB) datasets. Version 1.3.6 fixes Pandas 2.0 compatibility. Releases are periodic, with occasional major dataset updates.","status":"active","version":"1.3.6","language":"python","source_language":"en","source_url":"https://github.com/snap-stanford/ogb","tags":["graph","benchmark","pytorch-geometric","dgl","dataset","ogbn","ogbl","ogbg"],"install":[{"cmd":"pip install ogb","lang":"bash","label":"Latest PyPI release"}],"dependencies":[{"reason":"Core dependency for graph data structures","package":"numpy","optional":false},{"reason":"Used for tabular data loading","package":"pandas","optional":false},{"reason":"Progress bars for downloads","package":"tqdm","optional":false},{"reason":"For evaluation metrics (e.g., ROC-AUC)","package":"scikit-learn","optional":true},{"reason":"For PyTorch tensor conversion and dataloaders","package":"torch","optional":true}],"imports":[{"note":"OGB provides PyG/DGL wrapper datasets; raw import is rarely used.","wrong":"from ogb.nodeproppred import NodePropertyPrediction","symbol":"dataset classes","correct":"from ogb.nodeproppred import PygNodePropPredDataset"},{"note":"Evaluator is dataset-specific, import from the correct submodule.","wrong":"from ogb.utils import Evaluator","symbol":"Evaluator","correct":"from ogb.nodeproppred import Evaluator"}],"quickstart":{"code":"from ogb.nodeproppred import PygNodePropPredDataset\nfrom ogb.nodeproppred import Evaluator\n\ndataset = PygNodePropPredDataset(name='ogbn-arxiv')\nsplit_idx = dataset.get_idx_split()\ntrain_idx, valid_idx, test_idx = split_idx['train'], split_idx['valid'], split_idx['test']\ngraph = dataset[0]\n\n# For evaluation, use the evaluator\nevaluator = Evaluator(name='ogbn-arxiv')\n# Example: dummy predictions and labels (for illustration only)\nimport torch\ny_pred = torch.randn(len(graph.y))\ny_true = graph.y\nresult = evaluator.eval({'y_pred': y_pred, 'y_true': y_true})\nprint(result)","lang":"python","description":"Load the ogbn-arxiv dataset using PyG wrapper and run a dummy evaluation."},"warnings":[{"fix":"Use ogbl-wikikg2 and ogbl-citation2; old names will raise a deprecation warning.","message":"Datasets ogbl-wikikg and ogbl-citation are deprecated; use ogbl-wikikg2 and ogbl-citation2 instead.","severity":"deprecated","affected_versions":"<1.2.4"},{"fix":"Replace ogbg-code with ogbg-code2 in dataset name.","message":"ogbg-code dataset is deprecated due to target leakage; use ogbg-code2.","severity":"deprecated","affected_versions":">=1.2.5"},{"fix":"Upgrade to ogb==1.3.5 or later (pip install --upgrade ogb).","message":"Import stuck bug in version 1.3.4: downloading may hang.","severity":"breaking","affected_versions":"1.3.4"},{"fix":"Pre-download manually or set OGB_CACHE_DIR environment variable to a cached location.","message":"OGB datasets download from external URLs. Offline or restricted networks may fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Use pandas<2.0 or upgrade ogb to 1.3.6+.","message":"Pandas 2.0 breaks compatibility with older ogb versions (<1.3.6).","severity":"gotcha","affected_versions":"<1.3.6"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install ogb","cause":"OGB is not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'ogb'"},{"fix":"Set environment variable 'OGB_USE_HTTPS=0' or use a proxy. Alternatively, manually download datasets.","cause":"SSL certificate issues, often in corporate or restrictive networks.","error":"urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed>"},{"fix":"Use correct dataset name, e.g., 'ogbn-arxiv', 'ogbl-ppa', 'ogbg-molhiv'. See ogb.stanford.edu/docs.","cause":"Typo in dataset name or dataset not part of OGB.","error":"OGBDatasetError: Dataset ogbn-arxiv is not found. Please check the dataset name."},{"fix":"Update ogb to latest version: pip install --upgrade ogb","cause":"Dataset URL has changed or version mismatch.","error":"RuntimeError: Could not download file from ... Reason: HTTP Error 404: Not Found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}