I'm trying to load my validation set. Initially, I was using CenterSpatialCropd in my set of transformations and everything worked well. Then, I tried to substitute this transform with RandCropByPosNegLabeld, since it fits my work better, but now, instead of having a list of dictionaries when I define the dataset, I have a list of lists.
Below is the code for the definition of the transforms:
print(f'Validation image shape {val_dataset[0]["image"].shape}') # dimensione prima immagine
TypeError: list indices must be integers or slices, not str
I'm trying to load my validation set. Initially, I was using
CenterSpatialCropd
in my set of transformations and everything worked well. Then, I tried to substitute this transform withRandCropByPosNegLabeld
, since it fits my work better, but now, instead of having a list of dictionaries when I define the dataset, I have a list of lists. Below is the code for the definition of the transforms:And here the error