我正在尝试按照指示在 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
输出为 -
查找“caffe2.python.operator_test.relu_op_test”的模块规范时出错(ModuleNotFoundError:没有名为“caffe2.python”的模块)
虽然我已成功运行其他命令,但任何人都可以指出我所犯的错误。 我怎么知道我是否已经成功安装了 caffe2?(上面的命令除外)
最佳答案
根据这个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())'
关于python - ubuntu 16.04如何知道Caffe2是否安装成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43851397/