class_docstr: An exception when a no training batch was available.
class_docstr_tok: ["An","exception","when","a","no","training","batch","was","available","."]
docstr: Initialize the error.
docstr_tok: ["Initialize","the","error","."]
code: def __init__(self):
      """Initialize the error."""
      super().__init__(
          "Did not have a single training batch! This typically happens if the batch_size is set larger "
          "than the number of training instances, and drop_last is set to True. The latter happens by default, if "
          "the model uses batch norm layers. You can try to fix this problem, by explicitly setting drop_last=False. "
          "If you are using the pipeline, you find the parameter in the training_kwargs. Further information can be "
          "found at https://github.com/pykeen/pykeen/issues/828 ."
      )
  
imports: import gc
  import logging
  import os
  import pathlib
  import pickle
  import random
  import time
  from abc import ABC, abstractmethod
  from contextlib import ExitStack
  from datetime import datetime
  from hashlib import md5
  from tempfile import NamedTemporaryFile, TemporaryDirectory
  from typing import IO, Any, ClassVar, Generic, List, Mapping, Optional, Tuple, TypeVar, Union
  import numpy
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from class_resolver.contrib.torch import lr_scheduler_resolver, optimizer_resolver
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader
  from tqdm.autonotebook import tqdm, trange
  from .callbacks import GradientAbsClippingTrainingCallback, GradientNormClippingTrainingCallback, LearningRateSchedulerTrainingCallback, MultiTrainingCallback, OptimizerTrainingCallback, StopperTrainingCallback, TrackerTrainingCallback, TrainingCallback, TrainingCallbackHint, TrainingCallbackKwargsHint
  from ..constants import PYKEEN_CHECKPOINTS, PYKEEN_DEFAULT_CHECKPOINT
  from ..lr_schedulers import LRScheduler
  from ..models import RGCN, Model
  from ..stoppers import Stopper
  from ..trackers import ResultTracker, tracker_resolver
  from ..triples import CoreTriplesFactory, TriplesFactory
  from ..typing import InductiveMode
  from ..utils import format_relative_comparison, get_batchnorm_modules, get_preferred_device, is_cuda_oom_error, is_cudnn_error, normalize_string
label_desc: Use image node_id 1 to create a new NoTrainingBatchError object from inherited base classes: RuntimeError with example: obj = NoTrainingBatchError()