-
Notifications
You must be signed in to change notification settings - Fork 0
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
Kcyganik small changes v03 #185
Conversation
The test will fail until SebChw/ART-Templates#33 is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside this setup()
issue LGTM.
You solved the issue but at cost of running setup dozen of times.
art/steps.py
Outdated
@@ -298,6 +298,10 @@ def validate(self, trainer_kwargs: Dict): | |||
Args: | |||
trainer_kwargs (Dict): Arguments to be passed to the trainer for validating the model. | |||
""" | |||
|
|||
if "datamodule" not in trainer_kwargs.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this solves the issue of setup? I run EvaluateBaselines step from tutorial and setup was run 6 times for 3 baselines. So you run setup to be able to pass train dataloader. Next lightning runs it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this if
inside validate
and test
seems not necessary. If "datamodule" is not in kwargs it means that a dataloader must be. If dataloader is inside trainer kwargs it means that setup must have been run already.
@@ -395,6 +402,8 @@ def do(self, previous_states: Dict): | |||
Args: | |||
previous_states (Dict): previous states | |||
""" | |||
# Running setup for ml_train with pure train dataloader | |||
self.datamodule.setup(stage=TrainingStage.TRAIN.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't scale well to new steps. My idea would be like this
add get_trainloader()
Function to the base with try catch statement. If it suceeds it just return train_dataloader if it fails it runs datamodule setup function and then returns train_dataloader.
Something like this:
def get_trainloader():
try:
return self.datamodule.get_trainloader()
except :
self.datamodule.setip()
return self.datamodule.get_Trainloader()
But this is just my idea maybe it can be done in other way
No description provided.