我正在使用我自己的数据创建一个ImageNet,我已成功将这两个数据库文件放在文件夹“DB_train”和“DB_verify”下的caffe根目录中。
我的make_imagenet_mean.sh
看起来像是:
#!/usr/bin/env sh
# Compute the mean image from the imagenet training lmdb
# N.B. this is available in data/ilsvrc12
EXAMPLE=/home/andrew/caffe/DB_train
DATA=/home/andrew/caffe/data/ilsvrc12
TOOLS=/home/andrew/caffe/build/tools
/home/andrew/caffe/build/tools/compute_image_mean /home/andrew/caffe/DB_train \
/home/andrew/caffe/data/ilsvrc12/imagenet_mean.binaryproto
echo "Done."
当我运行命令时:
andrew@ubuntu:~/caffe$ sudo ./examples/imagenet/make_imagenet_mean.sh
我收到错误:
./examples/imagenet/make_imagenet_mean.sh: 11: ./examples/imagenet/make_imagenet_mean.sh: data/ilsvrc12/imagenet_mean.binaryproto: Permission denied
Done.
为什么会发生这种情况的原因?
当我跑步时
GLOG_minloglevel=0 GLOG_logtostderr=1 /home/andrew/caffe/build/tools/compute_image_mean /home/andrew/caffe/DB_train /home/andrew/caffe/data/ilsvrc12/imagenet_mean.binaryproto
我得到了
I0215 01:42:17.412768 11659 db_lmdb.cpp:38] Opened lmdb /home/andrew/caffe/DB_train I0215 01:42:17.414031 11659 compute_image_mean.cpp:68] Starting Iteration I0215 01:42:17.660877 11659 compute_image_mean.cpp:99] Processed 400 files. I0215 01:42:17.661558 11659 compute_image_mean.cpp:106] Write to /home/andrew/caffe/data/ilsvrc12/imagenet_mean.binaryproto I0215 01:42:17.666162 11659 compute_image_mean.cpp:112] Number of channels: 3 I0215 01:42:17.666352 11659 compute_image_mean.cpp:117] mean_value channel [0]:132.566 I0215 01:42:17.666553 11659 compute_image_mean.cpp:117] mean_value channel [1]:150.438 I0215 01:42:17.666694 11659 compute_image_mean.cpp:117] mean_value channel [2]:154.507