beichen2012 / testMultiThreadCaffe2

测试caffe2的并行计算
0 stars 0 forks source link

cmake #1

Open qinb opened 5 years ago

qinb commented 5 years ago

非常感谢你提供这些代码,请问编译的cmake文件还有吗?能不能给我传一份,我这边编译无法通过,非常感谢!弱弱的问一句,您使用的是pytorch.1.0吗?

beichen2012 commented 5 years ago

版本是Pytorch1.0的。 工程里面本身就包含有CmakeLists.txt, 请问您哪里在出错了呢,是找不到torch吗?

qinb commented 5 years ago

版本是Pytorch1.0的。 工程里面本身就包含有CmakeLists.txt, 请问您哪里在出错了呢,是找不到torch吗?

多谢回答哈,我使用是源码安装的pytorch1.0。我在您的工程下面直接cmake .,显示的错误是:

By not providing "FindCaffe2.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Caffe2", but CMake did not find one.

Could not find a package configuration file provided by "Caffe2" with any of the following names: Caffe2Config.cmake caffe2-config.cmake

所以想问你是如何编译的呢?再次感谢哈!

beichen2012 commented 5 years ago

版本是Pytorch1.0的。 工程里面本身就包含有CmakeLists.txt, 请问您哪里在出错了呢,是找不到torch吗?

多谢回答哈,我使用是源码安装的pytorch1.0。我在您的工程下面直接cmake .,显示的错误是:

By not providing "FindCaffe2.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Caffe2", but CMake did not find one.

Could not find a package configuration file provided by "Caffe2" with any of the following names: Caffe2Config.cmake caffe2-config.cmake

所以想问你是如何编译的呢?再次感谢哈!

项目目录下的CMakeLists.txt,第9行:

# caffe2
if (${CMAKE_BUILD_TYPE} STREQUAL "Release" )
    list(APPEND CMAKE_PREFIX_PATH "/opt/Caffe2")
    message(STATUS "caffe2 in /opt/caffe2")
else()
    list(APPEND CMAKE_PREFIX_PATH "/opt/Caffe2-Debug")
    message(STATUS "caffe2 in /opt/caffe2-debug")
endif()

把里面的 /opt/Caffe2和(或) /opt/Caffe2-Debug改成你自己的Caffe2安装目录。