ImageNet Data Set

class deepobs.tensorflow.datasets.imagenet.imagenet(batch_size, data_augmentation=True, train_eval_size=50000)[source]

DeepOBS data set class for the ImageNet data set.


We use 1001 classes which includes an additional background class, as it is used for example by the inception net.

  • batch_size (int) -- The mini-batch size to use. Note that, if batch_size is not a divider of the dataset size the remainder is dropped in each epoch (after shuffling).
  • data_augmentation (bool) -- If True some data augmentation operations (random crop window, horizontal flipping, lighting augmentation) are applied to the training data (but not the test data).
  • train_eval_size (int) -- Size of the train eval dataset. Defaults to 10 000.

A tuple (x, y) of tensors, yielding batches of ImageNet images (x with shape (batch_size, 224, 224, 3)) and corresponding one-hot label vectors (y with shape (batch_size, 1001)). Executing these tensors raises a tf.errors.OutOfRangeError after one epoch.


A tensorflow operation initializing the dataset for the training phase.


A tensorflow operation initializing the testproblem for evaluating on training data.


A tensorflow operation initializing the testproblem for evaluating on test data.


A string-value tf.Variable that is set to train, train_eval or test, depending on the current phase. This can be used by testproblems to adapt their behavior to this phase.