def visualize_gt(self):
    '\n        Visualize dataloader for sanity check \n        '
    LOGGER.text('Visualizing dataset...', level=LoggerObserver.DEBUG)
    visualizer = Visualizer()
    batch = next(iter(self.trainloader))
    images = batch['inputs']
    batch = []
    for (idx, inputs) in enumerate(images):
        img_show = visualizer.denormalize(inputs)
        img_cam = TFF.to_tensor(img_show)
        batch.append(img_cam)
    grid_img = visualizer.make_grid(batch)
    fig = plt.figure(figsize=(8, 8))
    plt.axis('off')
    plt.imshow(grid_img)
    plt.tight_layout(pad=0)
    LOGGER.log([{'tag': 'Sanitycheck/batch/train', 'value': fig, 'type': LoggerObserver.FIGURE, 'kwargs': {'step': self.iters}}])
    batch = next(iter(self.valloader))
    images = batch['inputs']
    batch = []
    for (idx, inputs) in enumerate(images):
        img_show = visualizer.denormalize(inputs)
        img_cam = TFF.to_tensor(img_show)
        batch.append(img_cam)
    grid_img = visualizer.make_grid(batch)
    fig = plt.figure(figsize=(8, 8))
    plt.axis('off')
    plt.imshow(grid_img)
    plt.tight_layout(pad=0)
    LOGGER.log([{'tag': 'Sanitycheck/batch/val', 'value': fig, 'type': LoggerObserver.FIGURE, 'kwargs': {'step': self.iters}}])
Visualize dataloader for sanity check
def visualize_gt(self):
    '\n         \n        '
    LOGGER.text('Visualizing dataset...', level=LoggerObserver.DEBUG)
    visualizer = Visualizer()
    batch = next(iter(self.trainloader))
    images = batch['inputs']
    batch = []
    for (idx, inputs) in enumerate(images):
        img_show = visualizer.denormalize(inputs)
        img_cam = TFF.to_tensor(img_show)
        batch.append(img_cam)
    grid_img = visualizer.make_grid(batch)
    fig = plt.figure(figsize=(8, 8))
    plt.axis('off')
    plt.imshow(grid_img)
    plt.tight_layout(pad=0)
    LOGGER.log([{'tag': 'Sanitycheck/batch/train', 'value': fig, 'type': LoggerObserver.FIGURE, 'kwargs': {'step': self.iters}}])
    batch = next(iter(self.valloader))
    images = batch['inputs']
    batch = []
    for (idx, inputs) in enumerate(images):
        img_show = visualizer.denormalize(inputs)
        img_cam = TFF.to_tensor(img_show)
        batch.append(img_cam)
    grid_img = visualizer.make_grid(batch)
    fig = plt.figure(figsize=(8, 8))
    plt.axis('off')
    plt.imshow(grid_img)
    plt.tight_layout(pad=0)
    LOGGER.log([{'tag': 'Sanitycheck/batch/val', 'value': fig, 'type': LoggerObserver.FIGURE, 'kwargs': {'step': self.iters}}])