Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Fix incomplete test data module setup in Lightning inference #553

Merged
merged 2 commits into from
Aug 25, 2021

Conversation

dccastro
Copy link
Member

@dccastro dccastro commented Aug 19, 2021

In the current version of the inference code-path for Lightning containers, we call LightningDataModule.test_dataloader() directly, without calling prepare_data() or setup(). This can cause crashes or unexpected behaviour if users have implemented those methods.

According to the Lightning docs, the correct way to run a test loop is to provide the full datamodule as an argument to Trainer.test().

@dccastro dccastro changed the title Fix Lightning inference Fix incomplete test data module setup in Lightning inference Aug 19, 2021
@dccastro dccastro marked this pull request as ready for review August 19, 2021 11:26
@javier-alvarez
Copy link
Contributor

It looks like this is breaking some tests

@dccastro dccastro enabled auto-merge (squash) August 25, 2021 13:59
@dccastro dccastro merged commit b3516f3 into main Aug 25, 2021
@dccastro dccastro deleted the dacoelh/fix-lightning-inference branch August 25, 2021 14:18
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants