The problem of loading OGB dataset

When I using the following code (as shown in 4.5 Loading OGB datasets using ogb package — DGL 0.8.1 documentation) to load the OGB dataset,

import dgl
import torch
from ogb.graphproppred import DglGraphPropPredDataset
from dgl.dataloading import GraphDataLoader

def _collate_fn(batch):
    graphs = [e[0] for e in batch]
    g = dgl.batch(graphs)
    labels = [e[1] for e in batch]
    labels = torch.stack(labels, 0)
    return g, labels

# load
dataset = DglGraphPropPredDataset(name='ogbg-molhiv')
split_idx = dataset.get_idx_split()
# dataloader
train_loader = GraphDataLoader(dataset[split_idx["train"]], batch_size=32, shuffle=True, collate_fn=_collate_fn)
valid_loader = GraphDataLoader(dataset[split_idx["valid"]], batch_size=32, shuffle=False, collate_fn=_collate_fn)
test_loader = GraphDataLoader(dataset[split_idx["test"]], batch_size=32, shuffle=False, collate_fn=_collate_fn)

I have the following problem:

Traceback (most recent call last):
  File "", line 16, in <module>
    dataset = DglGraphPropPredDataset(name='ogbg-molhiv')
  File "/home/ssy/anaconda3/envs/ELG/lib/python3.7/site-packages/ogb/graphproppred/", line 68, in __init__
  File "/home/ssy/anaconda3/envs/ELG/lib/python3.7/site-packages/ogb/graphproppred/", line 100, in pre_process
    if decide_download(url):
  File "/home/ssy/anaconda3/envs/ELG/lib/python3.7/site-packages/ogb/utils/", line 13, in decide_download
    size = int(["Content-Length"])/GBFACTOR
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

I ran your code and it works well in my side. Here’s my env: dgl~0.8.1, ogb~1.3.2, ubuntu18.04. what about yours? could you try with the latest ogb and dgl?

It’s weird, my env here is dgl~0.8.1, ogb~1.3.3.

how about asking OGB? Maybe there’s some change btw 1.3.2 and 1.3.3