我正在尝试使用我自己的数字图像数据集来测试 mnist。
我为此编写了一个 python 脚本,但它给出了一个错误。错误在代码的第 16 行。实际上我无法发送图像进行测试。给我一些建议。提前致谢。
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']