Thank you for your quick response.
I changed the build directory and tried again. However another error appears:
C:\pytorch\torch/csrc/jit/tracer.h(314): warning C4273: 'torch::jit::tracer::addInputs': inconsistent dll linkage [C:\p
ytorch\build\caffe2\torch\torch_python.vcxproj]
  C:\pytorch\torch/csrc/jit/tracer.h(299): note: see previous definition of 'addInputs'
C:\pytorch\torch/csrc/jit/tracer.h(321): warning C4273: 'torch::jit::tracer::addInputs': inconsistent dll linkage [C:\p
ytorch\build\caffe2\torch\torch_python.vcxproj]
  C:\pytorch\torch/csrc/jit/tracer.h(305): note: see previous definition of 'addInputs'
  serialization.cpp
C:\pytorch\torch/csrc/jit/tracer.h(314): warning C4273: 'torch::jit::tracer::addInputs': inconsistent dll linkage [C:\p
ytorch\build\caffe2\torch\torch_python.vcxproj]
  C:\pytorch\torch/csrc/jit/tracer.h(299): note: see previous definition of 'addInputs'
C:\pytorch\torch/csrc/jit/tracer.h(321): warning C4273: 'torch::jit::tracer::addInputs': inconsistent dll linkage [C:\p
ytorch\build\caffe2\torch\torch_python.vcxproj]
  C:\pytorch\torch/csrc/jit/tracer.h(305): note: see previous definition of 'addInputs'
     Creating library C:/pytorch/build/lib/Release/torch_python.lib and object C:/pytorch/build/lib/Release/torch_pytho
  n.exp
init.cpp.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobject THPDeviceTy
pe) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_arg_parser.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobject TH
PDeviceType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
tensor_new.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobject THPDevice
Type) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
Event.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobject THPDeviceType)
 imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobject THPDeviceTy
pe) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_variable_methods.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobj
ect THPDeviceType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_torch_functions.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobje
ct THPDeviceType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_nn_functions.obj : warning LNK4049: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobject
THPDeviceType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_sugared_value.obj : warning LNK4217: locally defined symbol ?THPDeviceType@@3U_typeobject@@A (struct _typeobject
 THPDeviceType) imported in function "void __cdecl torch::jit::script::`dynamic initializer for 'empty_trees''(void)" (
??__Eempty_trees@script@jit@torch@@YAXXZ) [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4049: locally defined symbol ?THPDtypeType@@3U_typeobject@@A (struct _typeobject THPDtypeType
) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_variable_methods.obj : warning LNK4049: locally defined symbol ?THPDtypeType@@3U_typeobject@@A (struct _typeobje
ct THPDtypeType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_sugared_value.obj : warning LNK4049: locally defined symbol ?THPDtypeType@@3U_typeobject@@A (struct _typeobject
THPDtypeType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_tensor.obj : warning LNK4049: locally defined symbol ?THPDtypeType@@3U_typeobject@@A (struct _typeobject THPDtyp
eType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_arg_parser.obj : warning LNK4049: locally defined symbol ?THPDtypeType@@3U_typeobject@@A (struct _typeobject THP
DtypeType) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::TypeErro
r::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
Module.cpp.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::TypeEr
ror::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
tensor_apply.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::Type
Error::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
tensor_new.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::TypeEr
ror::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
tensor_numpy.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::Type
Error::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::TypeErro
r::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_variable.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::T
ypeError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_variable_indexing.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl
 torch::TypeError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_tensor.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::Typ
eError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_arg_parser.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch:
:TypeError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
DynamicTypes.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::Type
Error::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
Generator.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::TypeErr
or::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_function.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::T
ypeError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_legacy_variable.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl t
orch::TypeError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_variable_methods.obj : warning LNK4217: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl
torch::TypeError::TypeError(char const *,...)) imported in function "struct _object * __cdecl torch::autograd::THPVaria
ble_type(struct _object *,struct _object *,struct _object *)" (?THPVariable_type@autograd@torch@@YAPEAU_object@@PEAU3@0
0@Z) [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_torch_functions.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl t
orch::TypeError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
python_nn_functions.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torc
h::TypeError::TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
Device.obj : warning LNK4049: locally defined symbol ??0TypeError@torch@@QEAA@PEBDZZ (public: __cdecl torch::TypeError:
:TypeError(char const *,...)) imported [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4217: locally defined symbol ?ToONNX@jit@torch@@YA?AV?$shared_ptr@UGraph@jit@torch@@@std@@AEA
V34@W4OperatorExportTypes@onnx@2@@Z (class std::shared_ptr<struct torch::jit::Graph> __cdecl torch::jit::ToONNX(class s
td::shared_ptr<struct torch::jit::Graph> &,enum torch::onnx::OperatorExportTypes)) imported in function "void __cdecl t
orch::jit::initJITBindings(struct _object *)" (?initJITBindings@jit@torch@@YAXPEAU_object@@@Z) [C:\pytorch\build\caffe2
\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4217: locally defined symbol ?BlockToONNX@jit@torch@@YAXPEAUBlock@12@0W4OperatorExportTypes@o
nnx@2@V?$unordered_map@PEAUValue@jit@torch@@PEAU123@U?$hash@PEAUValue@jit@torch@@@std@@U?$equal_to@PEAUValue@jit@torch@
@@5@V?$allocator@U?$pair@QEAUValue@jit@torch@@PEAU123@@std@@@5@@std@@@Z (void __cdecl torch::jit::BlockToONNX(struct to
rch::jit::Block *,struct torch::jit::Block *,enum torch::onnx::OperatorExportTypes,class std::unordered_map<struct torc
h::jit::Value *,struct torch::jit::Value *,struct std::hash<struct torch::jit::Value *>,struct std::equal_to<struct tor
ch::jit::Value *>,class std::allocator<struct std::pair<struct torch::jit::Value * const,struct torch::jit::Value *> >
>)) imported in function "void __cdecl torch::jit::initJITBindings(struct _object *)" (?initJITBindings@jit@torch@@YAXP
EAU_object@@@Z) [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4217: locally defined symbol ?PrepareDivisionForONNX@jit@torch@@YAXAEBV?$shared_ptr@UGraph@ji
t@torch@@@std@@@Z (void __cdecl torch::jit::PrepareDivisionForONNX(class std::shared_ptr<struct torch::jit::Graph> cons
t &)) imported in function "void __cdecl torch::jit::initJITBindings(struct _object *)" (?initJITBindings@jit@torch@@YA
XPEAU_object@@@Z) [C:\pytorch\build\caffe2\torch\torch_python.vcxproj]
init.cpp.obj : warning LNK4217: locally defined symbol ?getRecursiveScriptMode@script@jit@torch@@YAAEA_NXZ (bool & __cd
ecl torch::jit::script::getRecursiveScriptMode(void)) imported in function "private: static class pybind11::handle __cd
ecl <lambda_699ff1579e5ea22a9941363e0bb1e852>::<lambda_invoker_cdecl>(struct pybind11::detail::function_call &)" (?<lam
bda_invoker_cdecl>@<lambda_699ff1579e5ea22a9941363e0bb1e852>@@CA?AVhandle@pybind11@@AEAUfunction_call@detail@3@@Z) [C:\
pytorch\build\caffe2\torch\torch_python.vcxproj]
  torch_python.vcxproj -> C:\pytorch\build\bin\Release\torch_python.dll
Traceback (most recent call last):
  File "setup.py", line 752, in <module>
    build_deps()
  File "setup.py", line 320, in build_deps
    build_dir='build')
  File "C:\pytorch\tools\build_pytorch_libs.py", line 88, in build_caffe2
    check_call(build_cmd, cwd=build_dir, env=my_env)
  File "C:\Users\gjben\Anaconda3\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '/maxcpucount:8']' returned non-zero exit status 1.

It happens when running:
python setup.py build --cmake