type(DataBunch.test_ds) == NoneType

I’m doing something pretty trivial:

from fastai import *
from fastai.vision import *
from torchsummary import summary
from collections import OrderedDict

class MyMnistDS(Dataset):

train_ds = MyMnistDS(train_x, train_y)
valid_ds = MyMnistDS(valid_x, valid_y)
test_ds  = MyMnistDS(test_x, test_y)
data = DataBunch.create(train_ds, valid_ds, test_ds)
len(data.train_ds), len(data.valid_ds) #len(data.test_ds)
#returns (51000, 9000)
type(data.train_ds), type(data.valid_ds), type(data.test_ds)
#returns (__main__.MyMnistDS, __main__.MyMnistDS, NoneType)

Notice the NoneType for data.test_ds. What happened to the type?

conda list | grep fastai
dataclasses               0.6                        py_0    fastai
fastai                    1.0.39                        1    fastai
fastprogress              0.1.18                     py_0    fastai
nvidia-ml-py3             7.352.0                    py_0    fastai
regex                     2018.01.10      py36h14c3975_1000    fastai
spacy                     2.0.18          py36hf484d3e_1000    fastai
torchvision               0.2.1                      py_0    fastai

Indeed, there was a mixup with the fix dataset since you’re not using fastai datasets. Should be fixed by this commit.

1 Like