nibabel.filebasedimages.ImageFileError

Hello,
I want to segment my .nrrd data. I use the following code , but I have this
error:
nibabel.filebasedimages.ImageFileError: Cannot work out file type of …

ROOT_DIR_GMCHALLENGE = “/media/elahe/d/data/dataset”
mri_input_filename = os.path.join(ROOT_DIR_GMCHALLENGE,
‘train’)
mri_gt_filename = os.path.join(ROOT_DIR_GMCHALLENGE,
‘labels’)
pair = mt_datasets.SegmentationPair2D(mri_input_filename, mri_gt_filename)

I would be appreciated if you help me.
Thanks