mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
testing multiple calles
This commit is contained in:
@@ -203,14 +203,17 @@ class LightningTemplateModel(LightningModule):
|
||||
|
||||
@ptl.data_loader
|
||||
def tng_dataloader(self):
|
||||
print('tng data loader called')
|
||||
return self.__dataloader(train=True)
|
||||
|
||||
@ptl.data_loader
|
||||
def val_dataloader(self):
|
||||
print('val data loader called')
|
||||
return self.__dataloader(train=False)
|
||||
|
||||
@ptl.data_loader
|
||||
def test_dataloader(self):
|
||||
print('test data loader called')
|
||||
return self.__dataloader(train=False)
|
||||
|
||||
@staticmethod
|
||||
|
||||
+2
-12
@@ -91,7 +91,7 @@ def run_prediction(dataloader, trained_model):
|
||||
assert val_acc > 0.70, f'this model is expected to get > 0.7 in test set (it got {val_acc})'
|
||||
|
||||
|
||||
def mainasdf():
|
||||
def main():
|
||||
|
||||
save_dir = init_save_dir()
|
||||
model, hparams = get_model()
|
||||
@@ -128,15 +128,5 @@ def mainasdf():
|
||||
clear_save_dir()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
print('getting pid')
|
||||
command = "lsof -i :%s | awk '{print $2}'" % 12910
|
||||
pids = subprocess.check_output(command, shell=True)
|
||||
pids = pids.strip()
|
||||
|
||||
print(len(pids))
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user