RuntimeError: bool value of Tensor with more than one value is ambiguous
First, thank you for this repository!
I'm not sure if this is a bug, or there's something wrong with how I'm setting up LightningModule.
I've used the exact same setup with pure PyTorch, and the model trains as expected, so I'm certain that this is an issue with Lightning.
Code
When I use this code...
class VideoClassification(pl.LightningModule):
    def __init__(self):
        super(VideoClassification, self).__init__()
        self.model = torchvision.models.video.r2plus1d_18(pretrained=True)
        
    def forward(self, x):
        return self.model.forward(x)
    
    def training_step(self, batch, batch_nb):
        x,y = batch
        y_hat = self.forward(x)
        loss = nn.CrossEntropyLoss(y_hat, y)
        tensorboard_logs = {'train_loss': loss}
        return {'loss': loss, 'log': tensorboard_logs}
    
    def configure_optimizers(self):
        optim = torch.optim.Adam(self.model.parameters(), lr=1e-2)
        lr_scheduler = torch.optim.lr_scheduler.OneCycleLR(
            optim, max_lr=5e-1, epochs=1,
            steps_per_epoch=len(self.train_dataloader())
        )
        return [optim], [lr_scheduler]
    
    @pl.data_loader
    def train_dataloader(self):
        return torch.utils.data.DataLoader(train_data, batch_size=2,
                                           sampler=FirstClipSampler(train_data.video_clips, 2),
                                           collate_fn=collate_fn)

model = VideoClassification()
trainer = Trainer(gpus=[0])
trainer.fit(model)
Error
... I get thisRuntimeError:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-d2581b3725c7> in <module>
      1 model = VideoClassification()
      2 trainer = Trainer(gpus=[0])
----> 3 trainer.fit(model)

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in fit(self, model)
    349 
    350         elif self.single_gpu:
--> 351             self.single_gpu_train(model)
    352 
    353         # ON CPU

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/dp_mixin.py in single_gpu_train(self, model)
     75             self.optimizers = optimizers
     76 
---> 77         self.run_pretrain_routine(model)
     78 
     79     def dp_train(self, model):

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in run_pretrain_routine(self, model)
    469 
    470         # CORE TRAINING LOOP
--> 471         self.train()
    472 
    473     def test(self, model=None):

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/train_loop_mixin.py in train(self)
     58             # RUN TNG EPOCH
     59             # -----------------
---> 60             self.run_training_epoch()
     61 
     62             # update LR schedulers

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/train_loop_mixin.py in run_training_epoch(self)
     97             # RUN TRAIN STEP
     98             # ---------------
---> 99             output = self.run_training_batch(batch, batch_nb)
    100             batch_result, grad_norm_dic, batch_step_metrics = output
    101 

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/train_loop_mixin.py in run_training_batch(self, batch, batch_nb)
    213 
    214                 # calculate loss
--> 215                 loss = optimizer_closure()
    216 
    217                 # nan grads

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/train_loop_mixin.py in optimizer_closure()
    182                     # forward pass
    183                     output = self.training_forward(
--> 184                         split_batch, batch_nb, opt_idx, self.hiddens)
    185 
    186                     closure_loss = output[0]

~/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/train_loop_mixin.py in training_forward(self, batch, batch_nb, opt_idx, hiddens)
    293             batch = self.transfer_batch_to_gpu(batch, gpu_id)
    294             args[0] = batch
--> 295             output = self.model.training_step(*args)
    296 
    297         # CPU forward

<ipython-input-6-74477a6bb330> in training_step(self, batch, batch_nb)
     10         x,y = batch
     11         y_hat = self.forward(x)
---> 12         loss = nn.CrossEntropyLoss(y_hat, y)
     13         tensorboard_logs = {'train_loss': loss}
     14         return {'loss': loss, 'log': tensorboard_logs}

~/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py in __init__(self, weight, size_average, ignore_index, reduce, reduction)
    909     def __init__(self, weight=None, size_average=None, ignore_index=-100,
    910                  reduce=None, reduction='mean'):
--> 911         super(CrossEntropyLoss, self).__init__(weight, size_average, reduce, reduction)
    912         self.ignore_index = ignore_index
    913 

~/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py in __init__(self, weight, size_average, reduce, reduction)
     17 class _WeightedLoss(_Loss):
     18     def __init__(self, weight=None, size_average=None, reduce=None, reduction='mean'):
---> 19         super(_WeightedLoss, self).__init__(size_average, reduce, reduction)
     20         self.register_buffer('weight', weight)
     21 

~/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py in __init__(self, size_average, reduce, reduction)
     10         super(_Loss, self).__init__()
     11         if size_average is not None or reduce is not None:
---> 12             self.reduction = _Reduction.legacy_get_string(size_average, reduce)
     13         else:
     14             self.reduction = reduction

~/anaconda3/lib/python3.7/site-packages/torch/nn/_reduction.py in legacy_get_string(size_average, reduce, emit_warning)
     34         reduce = True
     35 
---> 36     if size_average and reduce:
     37         ret = 'mean'
     38     elif reduce:

RuntimeError: bool value of Tensor with more than one value is ambiguous
I'm afraid I can't give you a reproducible example as I'd like to keep the dataset private. That being said, if you think that I've set my LightningModule up correctly, I can set up this example with a puiblic dataset and share the same.
Thank you for your help :)