我正在尝试将图片加载到网络并计算前5个错误率。我的数据层是
name: "CaffeNet"
layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
image_data_param {
source: "/home/filipa/PycharmProjects/Proposal_Code/Labels/val.txt"
}
}
其中val.txt文件具有每个图像和对应标签的名称。 (共50000张图片)
我的最后一层是
name: "fc8"
type: "InnerProduct"
bottom: "fc7"
top: "fc8"
inner_product_param {
num_output: 1000
}
}
layer {
name: "prob"
type: "Softmax"
bottom: "fc8"
top: "prob"
}
layer {
name: "accuracy_top_5"
type: "Accuracy"
bottom: "fc8"
bottom: "label"
top: "accuracy_top_5"
accuracy_param {
top_k: 5
}
include {
phase: TEST
}
}
我得到的错误是
E1116 11:34:28.173830 7465 io.cpp:80] Could not open or find file ILSVRC2012_val_00000001.JPEG
F1116 11:34:28.173835 7465 image_data_layer.cpp:72] Check failed: cv_img.data Could not load ILSVRC2012_val_00000001.JPEG
在我的代码中,我将图像加载到网络
im = caffe.io.load_image(IMAGE_FILE)
其中IMAGE_FILE指向我图像的确切位置。
答案 0 :(得分:1)
我会将原型文件编辑为:
image_data_param {
root_folder: "/home/filipa/PycharmProjects/root/folder/for/data"
source: "/home/filipa/PycharmProjects/Proposal_Code/Labels/val.txt"
}
然后在" val.txt"中设置路径相对于root_folder
。