Pytorch lightning validation_epoch_end error

def validation_epoch_end(self, outputs):
    	val_loss = torch.stack([x['val_loss'] for x in outputs]).mean()
    	log = {'avg_val_loss': val_loss}
    	return {'log': log, 'val_loss': log}

When i am using the above method in pytorh lightning it throws me an error TypeError: cannot unpack non-iterable NoneType object

This is happening before the last step of validation data. I can see that the return {'log': log, 'val_loss': log} is where the error is but couldnt actually find out whats wrong

Check if this part is returning the results as expected.

    def validation_epoch_end(self, outputs):
    	val_loss = torch.stack([x['val_loss'] for x in outputs]).mean()
    	log = {'avg_val_loss': val_loss}
    	return {'val_loss': val_loss, 'log': log}

I used it instead like this and now its working, thanks @Abhilash_Srivastava