Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect MisconfigurationException for models without dataloaders. #1496

Closed
yukw777 opened this issue Apr 15, 2020 · 1 comment · Fixed by #1495
Closed

Incorrect MisconfigurationException for models without dataloaders. #1496

yukw777 opened this issue Apr 15, 2020 · 1 comment · Fixed by #1495
Labels
bug Something isn't working help wanted Open to be worked on
Milestone

Comments

@yukw777
Copy link
Contributor

yukw777 commented Apr 15, 2020

🐛 Bug

I have a model that does not have train, val and test dataloaders defined internally (it's a production system and it doesn't really make sense to have dataloaders). If I try to run fit() on it by passing in train_dataloader and val_dataloaders, it raises

pytorch_lightning.utilities.exceptions.MisconfigurationException: You have defined `test_step()`, but have not passed in a `test_dataloader()`.

This means that it's now impossible to train a model without dataloaders defined, as there's no way of passing in test dataloaders. I believe this was caused by this PR: #1434. This is happening at the tip of master.

To Reproduce

Steps to reproduce the behavior:

  1. Checkout the master branch
  2. Define a model without data loaders
  3. Run fit() with train_dataloader and val_dataloaders
  4. See the exception

Code sample

# MyModel doesn't have train_dataloader, val_dataloader or test_dataloader
model = MyModel()
trainer = pl.Trainer()
trainer.fit(model, train_dataloader=train, val_dataloaders=val)  # exception raised here
trainer.test(test_dataloaders=test)

Expected behavior

There should be no exception raised during fit().

Environment

cuda:
	GPU:
	available:           False
	version:             None
packages:
	numpy:               1.18.1
	pyTorch_debug:       False
	pyTorch_version:     1.4.0
	pytorch-lightning:   0.7.4-dev
	tensorboard:         2.1.1
	tqdm:                4.43.0
system:
	OS:                  Darwin
	architecture:
		64bit
		
	processor:           i386
	python:              3.7.3
	version:             Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64

Additional context

@yukw777 yukw777 added bug Something isn't working help wanted Open to be worked on labels Apr 15, 2020
@yukw777
Copy link
Contributor Author

yukw777 commented Apr 15, 2020

Oops, it seems like it's already being fixed! #1495, thanks @williamFalcon!!

@Borda Borda added this to the 0.7.4 milestone Apr 15, 2020
@Borda Borda modified the milestones: 0.7.4, v0.7.x Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants