jiexiong2016 / GCNv2_SLAM

Real-time SLAM system with deep features
Other
782 stars 194 forks source link

Error compiling pytorch under windows #10

Open cugcsu opened 5 years ago

cugcsu commented 5 years ago

c:\users\administrator\pytorch\aten\src\aten\cpu\vec256\vec256_int.h(428): error C3861: “_mm256_extract_epi64”: 找不到标识符 (编译源文件C:\Users\Administrator\pytorch\build\aten\src\ATen\native\cpu\ReduceOpsKernel.cpp.AVX2.cpp)

When I use the compiled libtorch, I get an error when using it under Windows: "std":Unclear symbol(不明确的符号),ie.std::vector When I looked up the std statement, I found that pytorch defined many std namespaces, which caused the name to be duplicated.

cugcsu commented 5 years ago

@jiexiong2016

jiexiong2016 commented 5 years ago

Hi @cugcsu , I'm afraid I have limited knowledge about how to compile libtorch in Windows. The first error you pasted seems to be SSE related and the latter one might related to: https://discuss.pytorch.org/t/compiler-report-std-ambiguous-symbol-error-under-visual-c-2017/39459 and https://github.com/pytorch/pytorch/pull/17863. You probably have to redirect to pytorch repository and find whether it has a solution there.

cugcsu commented 5 years ago

Hi @cugcsu , I'm afraid I have limited knowledge about how to compile libtorch in Windows. The first error you pasted seems to be SSE related and the latter one might related to: https://discuss.pytorch.org/t/compiler-report-std-ambiguous-symbol-error-under-visual-c-2017/39459 and pytorch/pytorch#17863. You probably have to redirect to pytorch repository and find whether it has a solution there.

Do you know how to use the avx2 instruction set? In the vs project, I know that I can use the avx2 instruction set by enabling the enhanced instruction set, but in the cmakelists file, or somewhere else?

Thank your help, I have solved the second problem, in the C++ conformance mode, turn off /permissive-. Since I can't finish the compilation of pytorch, I used the release compiled on the official website, but there is c10::error: module = torch::jit::load(net_fn); the 'net_fn' is the full path to gcn2.pt.

jiexiong2016 commented 5 years ago

I think the flag for enabling avx2 is set in here: https://github.com/pytorch/pytorch/blob/84b275b70f73d5fd311f62614bccc405f3d5bfa3/cmake/Dependencies.cmake#L1196

Using the pre-built libtorch library can cause linking issue: https://github.com/jiexiong2016/GCNv2_SLAM/issues/2#issuecomment-470580288

The C10 error is probably caused by different version of CUDA as mentioned in another issue: https://github.com/jiexiong2016/GCNv2_SLAM/issues/3#issuecomment-472859235

chaiein commented 5 years ago

I think the flag for enabling avx2 is set in here: https://github.com/pytorch/pytorch/blob/84b275b70f73d5fd311f62614bccc405f3d5bfa3/cmake/Dependencies.cmake#L1196

Using the pre-built libtorch library can cause linking issue: #2 (comment)

The C10 error is probably caused by different version of CUDA as mentioned in another issue: #3 (comment) I have checked as per the Dependencies.cmake at Line1196. Still I couldnt solve this issue. What is the reason and how to solve this?

cugcsu commented 5 years ago

I think the flag for enabling avx2 is set in here: https://github.com/pytorch/pytorch/blob/84b275b70f73d5fd311f62614bccc405f3d5bfa3/cmake/Dependencies.cmake#L1196 Using the pre-built libtorch library can cause linking issue: #2 (comment) The C10 error is probably caused by different version of CUDA as mentioned in another issue: #3 (comment) I have checked as per the Dependencies.cmake at Line1196. Still I couldnt solve this issue. What is the reason and how to solve this?

I installed pytorch in another way: First, download the pytorch you need from here. Then, using pip install torch-1.0.1+cuda101-cp37-cp37m-win_amd64.whl But if you import this package in python, you will get the following error:

import torch Traceback (most recent call last):    File "", line 1, in    File "D:\SoftWare\Python\lib\site-packages\torch__init__.py", line 80, in      From torch._C import * ImportError: DLL load failed: The specified module could not be found.

At this time visit the following link:https://anaconda.org/anaconda/intel-openmp/files Go to the downloaded file directory intel-openmp-2019.0-117\Library\bin and copy libiomp5md.dll and libiompstubs5md.dll to the directory where Python.exe is located.