我正在尝试按照指示在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?(除上述命令外)
最佳答案
据此:
# 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 - 如何知道Caffe2是否已在ubuntu 16.04中成功安装?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43851397/