cannot unpack non-iterable NoneType object when predicting with test function/dataloader
Hi,
When trying to evaluate the autoencoder with test dataset, we got the error:
cannot unpack non-iterable NoneType object
def training_step(self, train_batch, batch_idx):
        x, _ = train_batch
        decoded, encoded = self.forward(x)
        loss = self.mse(decoded,x)
        tensorboard_logs = {'train_loss': loss}
        return {'loss': loss, 'log': tensorboard_logs}
def test_step(self,test_batch, batch_idx):
        x, _ = test_batch
        decoded, encoded = self.forward(x)
        return decoded, encoded
def test_dataloader(self):
        return DataLoader(dataset=Train_x_t_e, batch_size=self.hparams.batch_size)

# save model
me = Autoencoder.load_from_checkpoint(checkpoint_path="testmodel.ckpt")
# predict autoencoder result
trainer = pl.Trainer()
y_hat, z = trainer.test(me)

Got this error:
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py:23: RuntimeWarning: You passed  in a `test_dataloader` and have defined a `test_step()`, you may also want to define `test_epoch_end()` for accumulating stats.
  warnings.warn(*args, **kwargs)
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py:23: UserWarning: The dataloader, test dataloader 0, does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` in the `DataLoader` init to improve performance.
  warnings.warn(*args, **kwargs)
HBox(children=(FloatProgress(value=1.0, bar_style='info', description='Testing', layout=Layout(flex='2'), max=…
--------------------------------------------------------------------------------
TEST RESULTS
{}
--------------------------------------------------------------------------------


TypeErrorTraceback (most recent call last)
<ipython-input-111-f27519f8b5a7> in <module>
----> 1 y_hat, z = trainer.test(me)

TypeError: cannot unpack non-iterable NoneType object