2
我試圖用我自己的數字圖像數據集來測試mnist。
我寫了一個python腳本,但它給出了一個錯誤。錯誤在第16行代碼中。其實我無法發送圖像進行測試。給我一些建議。提前致謝。如何在我自己的數據集圖像上測試mnist
import numpy as np
import sys
import caffe
import matplotlib.pyplot as plt
import os
caffe_root = '../caffe-master/'
MODEL_FILE = './examples/mnist/lenet.prototxt'
PRETRAINED = './examples/mnist/lenet_iter_10000.caffemodel'
IMAGE_FILE = '/home/hemant/OpenCVProject/grey/img001-00001.png'#image path
input_image = caffe.io.load_image(IMAGE_FILE)
net = caffe.Net(MODEL_FILE, PRETRAINED,caffe.TEST)
caffe.set_mode_cpu()
out = net.forward([input_image])
print out['prob']