use tmpdir in tests when writing predictions to disk (#3561)
* save to tmpdir * path
This commit is contained in:
parent
2db86381c6
commit
3affa0e49a
|
@ -79,7 +79,7 @@ def test_result_obj_predictions(tmpdir, test_option, do_train, gpus):
|
|||
tutils.reset_seed()
|
||||
|
||||
dm = TrialMNISTDataModule(tmpdir)
|
||||
prediction_file = Path('predictions.pt')
|
||||
prediction_file = Path(tmpdir) / 'predictions.pt'
|
||||
|
||||
model = EvalModelTemplate()
|
||||
model.test_option = test_option
|
||||
|
@ -131,7 +131,7 @@ def test_result_obj_predictions_ddp_spawn(tmpdir):
|
|||
|
||||
dm = TrialMNISTDataModule(tmpdir)
|
||||
|
||||
prediction_file = Path('predictions.pt')
|
||||
prediction_file = Path(tmpdir) / 'predictions.pt'
|
||||
|
||||
model = EvalModelTemplate(learning_rate=0.005)
|
||||
model.test_option = option
|
||||
|
@ -141,7 +141,7 @@ def test_result_obj_predictions_ddp_spawn(tmpdir):
|
|||
model.test_epoch_end = None
|
||||
model.test_end = None
|
||||
|
||||
prediction_files = [Path('predictions_rank_0.pt'), Path('predictions_rank_1.pt')]
|
||||
prediction_files = [Path(tmpdir) / 'predictions_rank_0.pt', Path(tmpdir) / 'predictions_rank_1.pt']
|
||||
for prediction_file in prediction_files:
|
||||
if prediction_file.exists():
|
||||
prediction_file.unlink()
|
||||
|
|
Loading…
Reference in New Issue