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

Fixes print issues and data_loader #1080

Merged
merged 5 commits into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pytorch_lightning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
from .core import LightningModule
from .trainer import Trainer
from .callbacks import Callback
from .core import data_loader

__all__ = [
'Trainer',
'LightningModule',
'Callback',
'data_loader'
]
# __call__ = __all__
3 changes: 2 additions & 1 deletion pytorch_lightning/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ def test_dataloader(self):

"""

from .decorators import data_loader
from .lightning import LightningModule

__all__ = ['LightningModule']
__all__ = ['LightningModule', 'data_loader']
# __call__ = __all__
8 changes: 1 addition & 7 deletions pytorch_lightning/core/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def forward(self, x):

"""
if self.trainer.proc_rank == 0:
log.info(*args, **kwargs)
print(*args, **kwargs)

@abstractmethod
def forward(self, *args, **kwargs):
Expand Down Expand Up @@ -1189,9 +1189,6 @@ def test_dataloader(self):
.. note:: If you don't need a test dataset and a test_step, you don't need to implement
this method.

.. note:: If you want to change the data during every epoch DON'T use the data_loader
decorator.

"""
return None

Expand Down Expand Up @@ -1257,9 +1254,6 @@ def val_dataloader(self):
.. note:: If you don't need a validation dataset and a validation_step, you don't need to
implement this method.

.. note:: If you want to change the data during every epoch DON'T use the data_loader
decorator.

.. note:: In the case where you return multiple `val_dataloaders`, the `validation_step`
will have an argument `dataset_idx` which matches the order here.
"""
Expand Down
3 changes: 2 additions & 1 deletion pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,9 @@ def fit(
# feed to .fit()

"""
# bind logger
# bind logger and other properties
model.logger = self.logger
self.copy_trainer_model_properties(model)

# set up the passed in dataloaders (if needed)
self.__attach_dataloaders(model, train_dataloader, val_dataloaders, test_dataloaders)
Expand Down