Skip to content

Monitor data loading time with lightning #1057

Answered by arthursw
arthursw asked this question in Q&A
Discussion options

You must be logged in to vote

I just created a test script to profile processing speed ; it creates a queue of patches and consumes them:

import argparse
import datetime
import multiprocessing
from pathlib import Path
import torch
import torchio as tio
import lovely_tensors as lt
lt.monkey_patch()

seed = 42 
num_workers = multiprocessing.cpu_count() // 2

parser = argparse.ArgumentParser(prog=__file__, formatter_class=argparse.ArgumentDefaultsHelpFormatter, description="""Test data augmentation.""")
parser.add_argument('-d', '--dataset', required=True, help='Path to the test dataset folder.')
args = parser.parse_args()

dataset_dir = Path(args.dataset)
subject_paths = list((dataset_dir).iterdir())
subjects = []
for s…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by fepegar
Comment options

You must be logged in to vote
1 reply
@arthursw
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants