imagenet_mean.binaryproto: Permission denied error when running make_imagenet_mean.sh

206 views
Skip to first unread message

Andrew Hu

unread,
Feb 15, 2016, 2:28:05 AM2/15/16
to Caffe Users
I'm making an ImageNet with my own data which I have successfully made into two database files in the caffe root directory under folders "DB_train" and "DB_verify".

My make_imagenet_mean.sh looks like:


#!/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."



When I run the command:

andrew@ubuntu:~/caffe$ sudo ./examples/imagenet/make_imagenet_mean.sh


I get the error:

./examples/imagenet/make_imagenet_mean.sh: 11: ./examples/imagenet/make_imagenet_mean.sh: data/ilsvrc12/imagenet_mean.binaryproto: Permission denied
Done.


Any reason as to why this is happening?

Jan C Peters

unread,
Feb 15, 2016, 4:00:31 AM2/15/16
to Caffe Users
Why on earth are you using sudo? Do you know what that command is for? You are working in your own local home folder as far as I can say from your text, so there is no need to anything related to caffe with sudo (other than when installing the dependencies). This error is related to file ownership and access rights in Linux, not to caffe in any way. Read up on that first, please only post caffe-related questions here.

Jan

Andrew Hu

unread,
Feb 15, 2016, 4:20:31 AM2/15/16
to Caffe Users
I used sudo because when it gave me the "Permission denied" I thought that I had to run it with sudo. Also, calm down, you are judging my question based off of false assumptions. I'm entirely new to caffe and machine learning in general, so when I get the Permission denied error I don't know where it came from.

If I had the knowledge that this question had nothing to do with Caffe but rather with Linux, why would I post it?

And by the way, this IS Caffe related because many other people that are new to this may have the same error and may come here to find the answer. But thanks for the answer anyways

Jan C Peters

unread,
Feb 15, 2016, 4:44:25 AM2/15/16
to Caffe Users
Sorry for the outburst, that wasn't called for. My accumulated frustration reached the spilling threshold apparently. But now everything is all good again :-).

Check file access permissions on the imagenet_mean.binaryproto with ls -l. As I said there should be no reason here to use sudo.

Still, saying this is caffe-related is a long stretch. By your argument every Linux problem a newbie runs into while trying to use caffe is caffe-related. And that could be everything really, from errors in the building process, dependency compilation/installation, filesystem handling, downloading and uploading stuff, using python, matlab on linux, hardware drivers,... These problem are as related to caffe as they are related to any other open source software framework out there. That being said, being a Linux newbie is not a bad thing, every one of us has been one at some point. You learn lots of stuff, how an operating system actually works, interna that are usually hidden and covered up in other OSs like Windows or Mac OS. The thing is: caffe is not an out-of-the-box system, you cannot expect to get it to work and work well without investing (possibly a lot of) time and work. If that is not an option for you, maybe Torch or Tensorflow are better suited for you. And this should not discourage you, I am merely stating facts someone aiming to work with caffe should know.

Jan
Reply all
Reply to author
Forward
0 new messages