3

I am trying install caffe2 as instructed, on https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile, but when I try to run the command

python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"

it echo failure. further when I run next command

python -m caffe2.python.operator_test.relu_op_test

It gives output as - Error while finding module specification for 'caffe2.python.operator_test.relu_op_test' (ModuleNotFoundError: No module named 'caffe2.python')

While I have successfully run the other commands, Can anyone please point out the mistake/s I am committing. How do I know if i have successfully installed caffe2 ?(other than above command)

matejm
  • 270
  • 1
  • 10
Abby Jangir
  • 55
  • 2
  • 12
  • Did the compilation work without any errors? – hbaderts May 09 '17 at 06:31
  • Actually are few commands on the link (In question) for installing caffe2, I tried installing using them but last two commands are not giving required results, all the commands before that were successful. – Abby Jangir May 11 '17 at 08:32
  • Can you check that your build directory is in `PYTHONPATH`? – hbaderts May 11 '17 at 08:55
  • ... or execute that command from the build folder. There must be some errors in the previous commands. Try `make clean`, rebuild, and post the end of the output from the `sudo make install` command. – Jonathan May 17 '17 at 09:10

1 Answers1

2

According to this post:

# To check if Caffe2 build was successful
python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"

# To check if Caffe2 GPU build was successful
# This must print a number > 0 in order to use Detectron
python -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'
Tengerye
  • 1,796
  • 1
  • 23
  • 46