@Mazhar_Shaikh, I changed the following line,
`    def getitem(self,idx):
img_name = os.path.join(self.root_dir, str(self.data[‘ID’][idx]))
patches, p_id = np.load(img_name)
    img_class = self.data.iloc[idx,2]

    side = self.data.iloc[idx,1]

    if (self.data['SIDE'][idx,:1]==1):
    # #if (self.data.iloc[idx,0]) ==1:
     image = np.array(patches['R'].astype('uint8'), 'L')                                              #[image['R':side]|image['L':side]]
    else:
     image = np.array(patches['L'].astype('uint8'), 'L')

     if self.transform is not None:
        image = self.transform(image)




    sample = {'image': image, 'grade':img_class}


    return sample

`
now i am getting the new error
runfile('/home/fatema/Downloads/practice1.py', wdir='/home/fatema/Downloads')
Traceback (most recent call last):
  File "/home/fatema/miniconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 3325, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-052e1fda1dc0>", line 1, in <module>
    runfile('/home/fatema/Downloads/practice1.py', wdir='/home/fatema/Downloads')
  File "/home/fatema/Downloads/pycharm-professional-2019.1.3/pycharm-2019.1.3/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/home/fatema/Downloads/pycharm-professional-2019.1.3/pycharm-2019.1.3/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/fatema/Downloads/practice1.py", line 98, in <module>
    sample = train_data[i]
  File "/home/fatema/Downloads/practice1.py", line 64, in __getitem__
    patches, p_id = np.load(img_name)
  File "/home/fatema/miniconda3/lib/python3.6/site-packages/numpy/lib/npyio.py", line 422, in load
    fid = open(os_fspath(file), "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/fatema/Downloads/homework/datasetA/p26crops/9000099'