torch 安装错误问题

如下错误:

lib/THC/CMakeFiles/THC.dir/build.make:4243: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o] Error 1
/pkgbuild/torch/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(393): error: more than one operator "==" matches these operands:
            function "operator==(const __half &, const __half &)"
            function "operator==(half, half)"
            operand types are: half == half

/pkgbuild/torch/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 

解决方法:

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

如下错误:

error: more than one operator "==" matches these operands:

解决方法:

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__" 

 

测试

# th
require “cudnn”
cudnn.benchmark = true 
cudnn.fastest = true
cudnn.verbose = true #bydeault set to false 

你可能感兴趣的:(torch 安装错误问题)