Caffe - 检查失败:mdb_status == 0(2 对 0)没有这样的文件或目录
Caffe - Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
我正在尝试训练用于人脸识别的自定义 Caffe 模型。
(此处参考Github项目:https://github.com/danduncan/HappyNet)
为此,我为 Caffe 使用了 Docker 图像(有效),
在我机器上的 sharedfolder 中:
Docker 共享文件夹结构:
execute_3_train_custom_model
datasets/
mean_training_image.binaryproto
training_set_lmdb/
data.mdb
lock.mdb
models/
custom_Model/
deploy.prototxt
EmotiW_VGG_S.caffemodel
loss_history.txt
solver.prototxt
train.prototxt
在培训中,我运行在命令行中编写脚本:
execute_3_train_custom_model:
time ~/caffe/build/tools/caffe train -solver models/Custom_Model/solver.prototxt -weights models/Custom_Model/EmotiW_VGG_S.caffemodel | tee caffe_loss_history.txt
像这样:
root@3f3220158436:~/sharedfolder/caffe/docker/image/happyNet# sudo ./execute_3_train_custom_model
其他相关文件:
train.prototxt
name: "CaffeNet"
layers {
name: "training_train"
type: DATA
data_param {
source: "datasets/training_set_lmdb"
backend: LMDB
batch_size: 400
}
transform_param{
mean_file: "datasets/mean_training_image.binaryproto"
}
top: "data"
top: "label"
include {
phase: TRAIN
}
}
layers {
name: "training_test"
type: DATA
data_param {
source: "datasets/validation_set_lmdb"
backend: LMDB
batch_size: 14
}
transform_param{
mean_file: "datasets/mean_training_image.binaryproto"
}
top: "data"
top: "label"
include {
phase: TEST
}
(...)
solver.prototxt
net: "models/Custom_Model/train.prototxt"
# test_iter specifies how many forward passes the test should carry out
test_iter: 1
# Carry out testing every X training iterations
test_interval: 20
# Learning rate and momentum parameters for Adam
base_lr: 0.001
momentum: 0.9
momentum2: 0.999
# Adam takes care of changing the learning rate
lr_policy: "fixed"
# Display every X iterations
display: 10
# The maximum number of iterations
max_iter: 3000
# snapshot intermediate results
snapshot: 100
snapshot_prefix: "snapshot"
# solver mode: CPU or GPU
type: "Adam"
solver_mode: CPU
但是当我 运行 脚本时,我得到以下回溯:
I0415 01:49:52.260529 148 layer_factory.hpp:77] Creating layer training_test
I0415 01:49:52.260713 148 net.cpp:91] Creating Layer training_test
I0415 01:49:52.260766 148 net.cpp:399] training_test -> data
I0415 01:49:52.260816 148 net.cpp:399] training_test -> label
I0415 01:49:52.260861 148 data_transformer.cpp:25] Loading mean file from: datasets/mean_training_image.binaryproto
F0415 01:49:52.268076 153 db_lmdb.hpp:15] Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
*** Check failure stack trace: ***
@ 0x7f9e61bf7daa (unknown)
@ 0x7f9e61bf7ce4 (unknown)
@ 0x7f9e61bf76e6 (unknown)
@ 0x7f9e61bfa687 (unknown)
@ 0x7f9e6229d0b1 caffe::db::LMDB::Open()
@ 0x7f9e6224d754 caffe::DataReader::Body::InternalThreadEntry()
@ 0x7f9e6072ca4a (unknown)
@ 0x7f9e6050b184 start_thread
@ 0x7f9e60a3137d (unknown)
@ (nil) (unknown)
real 0m1.741s
user 0m0.580s
sys 0m1.230s
我想知道我是否以某种方式弄乱了我的路径,因为我正在使用 Docker,而且我不知道如何调试它。
看来你应该有两个 lmdbs:
datasets/training_set_lmdb # which you seem to have
datasets/validation_set_lmdb # where is this one?
当 caffe 为 phase: TEST
构造层 "training_test"
时,您会收到此错误:caffe 找不到 datasets/validation_set_lmdb
。确保你收到了。
我正在尝试训练用于人脸识别的自定义 Caffe 模型。
(此处参考Github项目:https://github.com/danduncan/HappyNet)
为此,我为 Caffe 使用了 Docker 图像(有效), 在我机器上的 sharedfolder 中:
Docker 共享文件夹结构:
execute_3_train_custom_model
datasets/
mean_training_image.binaryproto
training_set_lmdb/
data.mdb
lock.mdb
models/
custom_Model/
deploy.prototxt
EmotiW_VGG_S.caffemodel
loss_history.txt
solver.prototxt
train.prototxt
在培训中,我运行在命令行中编写脚本:
execute_3_train_custom_model:
time ~/caffe/build/tools/caffe train -solver models/Custom_Model/solver.prototxt -weights models/Custom_Model/EmotiW_VGG_S.caffemodel | tee caffe_loss_history.txt
像这样:
root@3f3220158436:~/sharedfolder/caffe/docker/image/happyNet# sudo ./execute_3_train_custom_model
其他相关文件:
train.prototxt
name: "CaffeNet"
layers {
name: "training_train"
type: DATA
data_param {
source: "datasets/training_set_lmdb"
backend: LMDB
batch_size: 400
}
transform_param{
mean_file: "datasets/mean_training_image.binaryproto"
}
top: "data"
top: "label"
include {
phase: TRAIN
}
}
layers {
name: "training_test"
type: DATA
data_param {
source: "datasets/validation_set_lmdb"
backend: LMDB
batch_size: 14
}
transform_param{
mean_file: "datasets/mean_training_image.binaryproto"
}
top: "data"
top: "label"
include {
phase: TEST
}
(...)
solver.prototxt
net: "models/Custom_Model/train.prototxt"
# test_iter specifies how many forward passes the test should carry out
test_iter: 1
# Carry out testing every X training iterations
test_interval: 20
# Learning rate and momentum parameters for Adam
base_lr: 0.001
momentum: 0.9
momentum2: 0.999
# Adam takes care of changing the learning rate
lr_policy: "fixed"
# Display every X iterations
display: 10
# The maximum number of iterations
max_iter: 3000
# snapshot intermediate results
snapshot: 100
snapshot_prefix: "snapshot"
# solver mode: CPU or GPU
type: "Adam"
solver_mode: CPU
但是当我 运行 脚本时,我得到以下回溯:
I0415 01:49:52.260529 148 layer_factory.hpp:77] Creating layer training_test
I0415 01:49:52.260713 148 net.cpp:91] Creating Layer training_test
I0415 01:49:52.260766 148 net.cpp:399] training_test -> data
I0415 01:49:52.260816 148 net.cpp:399] training_test -> label
I0415 01:49:52.260861 148 data_transformer.cpp:25] Loading mean file from: datasets/mean_training_image.binaryproto
F0415 01:49:52.268076 153 db_lmdb.hpp:15] Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
*** Check failure stack trace: ***
@ 0x7f9e61bf7daa (unknown)
@ 0x7f9e61bf7ce4 (unknown)
@ 0x7f9e61bf76e6 (unknown)
@ 0x7f9e61bfa687 (unknown)
@ 0x7f9e6229d0b1 caffe::db::LMDB::Open()
@ 0x7f9e6224d754 caffe::DataReader::Body::InternalThreadEntry()
@ 0x7f9e6072ca4a (unknown)
@ 0x7f9e6050b184 start_thread
@ 0x7f9e60a3137d (unknown)
@ (nil) (unknown)
real 0m1.741s
user 0m0.580s
sys 0m1.230s
我想知道我是否以某种方式弄乱了我的路径,因为我正在使用 Docker,而且我不知道如何调试它。
看来你应该有两个 lmdbs:
datasets/training_set_lmdb # which you seem to have
datasets/validation_set_lmdb # where is this one?
当 caffe 为 phase: TEST
构造层 "training_test"
时,您会收到此错误:caffe 找不到 datasets/validation_set_lmdb
。确保你收到了。