Make GridPatchDataset cacheable by adding shapes parameter #5662
schellenchris
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
do you mean |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed computing the slices each epoch isn't really fast so I made the GridPatchDataset cacheable by adding a shapes parameter.
I compute the shapes
shapes = [nib.load(img).shape for img in imgs]
in advance, it's pretty fast. I hand the shapes over to the GridPatchDataset to compute the length of the dataset. For__getitem__
I store the sliced image so I just need to slice it once. For multi dimension slicing and overlaps it could get more complex but I think it's achievable. Handing the GridPatchDataset into CacheDataset managed to speed up my training.Beta Was this translation helpful? Give feedback.
All reactions