Skip to content Skip to sidebar Skip to footer

Couldn't Find File At A Specified Relative Path In Python

Normally in Python, the default folder should be the current working directory I assume, or maybe in the default user directory. However, after running the following code from here

Solution 1:

I've also run these examples and the path for me gets stored in c:. I'm using windows.

The complete path is:

C:\tmp\tensorflow\mnist\input_data

If you want it to be relative to your working directory add a dot (".") before the path in your code:

parser.add_argument('--data_dir', type=str, default='./tmp/tensorflow/mnist/input_data',
                      help='Directory for storing input data')

Post a Comment for "Couldn't Find File At A Specified Relative Path In Python"