def predict(image_path, model, top_k=top_num):
model.to(power)
model.eval()

torch_image =torch.from_numpy(np.expand_dims(process_image(image_path),
                                        axis = 0)).type(torch.FloatTensor).to(power)

  
log_prob = model.forward(torch_image)

linear_probs = torch.exp(log_prob)   

top_probs, top_labs = linear_probs.topk(top_k, dim =1)

idx_to_class = {}
for key, value in model.class_to_idx.items():
    idx_to_class[value] = key

np_top_labs = top_labs[0].numpy()

top_labels = []
for label in np_top_labs:
    top_labels.append(int(idx_to_class[label]))

top_flowers = [cat_to_name[str(lab)] for lab in top_labels]

return top_probs, top_labels, top_flowers

image_path = path_image
prob, classes, flowers = predict(image_path,model)