How to pass datapath of a dataset to python program

i am running a program , in which i have to use a dataset of images, now i need to give datapath of dataset to python program. i have tried so many methods to do the same but i failed. i got following error
ipython-input-6-20f5453ca716> in ()
3 t_no = 0
4 for img_no in range(20):
----> 5 imD = + str(img_no+21) + ‘_training.tif’)
6 imD = np.array(imD)

/home/user/anaconda2/lib/python2.7/site-packages/PIL/Image.pyc in open(fp, mode)
2476 if filename:
-> 2477 fp =, “rb”)
2478 exclusive_fp = True
IOError: [Errno 2] No such file or directory: ‘/home/user/Desktop/images21_training.tif’
Thank you

hmm are you sure that your Datapath is set correctly?

Thanks to consider my problem
Actually I am new to Linux (Ubuntu 16.04) and pytorch . I have downloaded the data set in home/users/download. Now I need to pass datapath of dataset to program . What will be datapath of this dataset.

According to your code it should be /home/users/download (or equivalent relevant path). This is more of a python question btw.

yes, i also think that but still my program is not error free.
plz, if possible help me.

What kind of error message do you get?
Still that the file cannot be found?

meaning of error is my program is not able to open the images means program cannot access the dataset through the datapath provided to program

Could you type ls your_path in your Terminal? It seems the file does not exist.