How can I find a solution for the "FileNotFoundError"
I'm currently working on an image classifier project. During the testing of the predict function, I receive the error: FileNotFoundError: [Errno 2] No such file or directory: 'flowers/test/1/image_06760'

the path of the file is correct.
You can find the whole notebook here: 
https://github.com/MartinTschendel/image-classifier-1/blob/master/190829-0510-Image%20Classifier%20Project.ipynb

Here is the respective predict function and the test of this function:

def predict(image_path, model, topk=5):
    ''' Predict the class (or classes) of an image using a trained deep learning model.
    '''

    #loading model
    loaded_model = load_checkpoint(model)

    # implement the code to predict the class from an image file
    img = Image.open(image_name)
    img = process_image(img)

    # convert 2D image to 1D vector
    img = np.expand_dims(img, 0)

    img = torch.from_numpy(img)

    #set model to evaluation mode and turn off gradients
    loaded_model.eval()
    with torch.no_grad():
        #run image through network
        output = loaded_model.forward(img)

    #calculate probabilities
    probs = torch.exp(output)
    probs_top = probs.topk(topk)[0]
    index_top = probs.topk(topk)[1]

    # Convert probabilities and outputs to lists
    probs_top_list = np.array(probs_top)[0]
    index_top_list = np.array(index_top[0])

    #load index and class mapping
    loaded_model.class_to_idx = train_data.class_to_idx
    #invert index-class dictionary
    idx_to_class = {x: y for y, x in class_to_idx.items()}

    #convert index list to class list
    classes_top_list = []
    for index in index_top_list:
        classes_top_list += [idx_to_class[index]]

    return probs_top_list, classes_top_list


# test predict function

# inputs equal paths to saved model and test image
model_path = '190824_checkpoint.pth'
image_name = data_dir + '/test' + '/1/' + 'image_06760'

probs, classes = predict(image_name, model_path, topk=5)

print(probs)
print(classes)


This is the error I receive: 

FileNotFoundError: [Errno 2] No such file or directory: 'flowers/test/1/image_06760'


These are the images you have 



You should have it as 

image_name = data_dir + '/test' + '/1/' + 'image_06760.jpg' 

for it to work as you were not specifying the image extension.
