BUG|Torch编译错误

问题:

/home/weishu/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(414): error: more than one operator "==" matches these operands:

function "operator==(const __half &, const __half &)"

function "operator==(half, half)"

operand types are: half == half

2 errors detected in the compilation of "/tmp/tmpxft_000053e0_00000000-6_THCTensorMath.cpp1.ii".

CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message):

Error generating file

/home/weishu/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:112: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o' failed

make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1

make[2]: *** Waiting for unfinished jobs....

CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed

make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2

Makefile:127: recipe for target 'all' failed

make: *** [all] Error 2

Error: Build error: Failed building.

解决方案:

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

你可能感兴趣的:(BUG|Torch编译错误)