3

我正在尝试按照说明在https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile上安装 caffe2 ,但是当我尝试运行命令时

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

它回显失败。当我运行下一个命令时

python -m caffe2.python.operator_test.relu_op_test

它给出的输出为 - Error while finding module specification for 'caffe2.python.operator_test.relu_op_test' (ModuleNotFoundError: No module named 'caffe2.python')

虽然我已成功运行其他命令,但谁能指出我犯的错误。我怎么知道我是否已经成功安装了 caffe2 ?(除了上面的命令)

4

1 回答 1

1

根据这篇文章

# 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())'
于 2018-10-13T08:09:18.260 回答