Error when calling pip install -v -e

Sylvain_Ard: <p>Hello all !<br>
when I call  “pip install -v -e .” on the code of <a href="https://github.com/Epiphqny/SOLOv2" rel="noopener nofollow ugc">https://github.com/Epiphqny/SOLOv2</a> I got on Windows 10 the following error :</p>
<p>(SoloV2) (…)<br>
Remarqueÿ: inclusion du fichierÿ:       C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/utils/tensor_numpy.h<br>
Remarqueÿ: inclusion du fichierÿ:     C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/Generator.h<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\nms\src\nms_cuda.cpp(9): error C3861: 'AT_CHECK’ÿ: identificateur introuvable<br>
ninja: build stopped: subcommand failed.<br>
Traceback (most recent call last):<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py”, line 1667, in _run_ninja_build<br>
subprocess.run(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\subprocess.py”, line 516, in run<br>
raise CalledProcessError(retcode, process.args,<br>
subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.</p>
<pre><code>The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
  File "C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py", line 217, in &lt;module&gt;
    setup(
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\develop.py", line 34, in run
    self.install_for_development()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\develop.py", line 136, in install_for_development
    self.run_command('build_ext')
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
    _build_ext.run(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 708, in build_extensions
    build_ext.build_extensions(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 681, in win_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 1354, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 1683, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
    return stream.closed
ValueError: underlying buffer has been detached
</code></pre>
<p>ERROR: Command errored out with exit status 1: ‘C:\ProgramData\Anaconda3\envs\SoloV2\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’; <strong>file</strong>=’"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(<strong>file</strong>);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, <strong>file</strong>, ‘"’"‘exec’"’"’))’ develop --no-deps Check the logs for full command output.<br>
Exception information:<br>
Traceback (most recent call last):<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\cli\base_command.py”, line 189, in <em>main<br>
status = self.run(options, args)<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\cli\req_command.py”, line 178, in wrapper<br>
return func(self, options, args)<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\commands\install.py”, line 391, in run<br>
installed = install_given_reqs(<br>
File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\req_<em>init</em></em>.py", line 80, in install_given_reqs<br>
requirement.install(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\req\req_install.py”, line 764, in install<br>
install_editable_legacy(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\operations\install\editable_legacy.py”, line 49, in install_editable<br>
call_subprocess(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\utils\subprocess.py”, line 258, in call_subprocess<br>
raise InstallationSubprocessError(proc.returncode, command_desc)<br>
pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: ‘C:\ProgramData\Anaconda3\envs\SoloV2\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’; <strong>file</strong>=’"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(<strong>file</strong>);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, <strong>file</strong>, ‘"’"‘exec’"’"’))’ develop --no-deps Check the logs for full command output.<br>
Removed build tracker: ‘C:\Users\MASTER\AppData\Local\Temp\pip-req-tracker-shii74p4’</p>
<p>(SoloV2) C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master&gt;</p>

Sylvain_Ard: <p>I precise that I have Cuda 11.4</p>

Sylvain_Ard: <p>I changed line 4 of nms_cuda.cpp to<br>
<span class="hashtag">#define</span> CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), <span class="hashtag">#x</span>, " must be a CUDAtensor ")<br>
replacing AT8CHECK by TORCH_CHECK<br>
and in roi_align_cuda.cpp<br>
but now I have this error :<br>
Remarqueÿ: inclusion du fichierÿ:      C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/THP_export.h<br>
Remarqueÿ: inclusion du fichierÿ:     C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/utils/python_tuples.h<br>
Remarqueÿ: inclusion du fichierÿ:      C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/Exceptions.h<br>
Remarqueÿ: inclusion du fichierÿ:       C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/utils/auto_gil.h<br>
Remarqueÿ: inclusion du fichierÿ:       C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/jit/runtime/jit_exception.h<br>
Remarqueÿ: inclusion du fichierÿ:       C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\ATen/detail/FunctionTraits.h<br>
Remarqueÿ: inclusion du fichierÿ:      C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/utils/object_ptr.h<br>
Remarqueÿ: inclusion du fichierÿ:      C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/utils/python_numbers.h<br>
Remarqueÿ: inclusion du fichierÿ:       C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/utils/tensor_numpy.h<br>
Remarqueÿ: inclusion du fichierÿ:     C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\include\torch/csrc/Generator.h<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(33): error C3861: 'AT_CHECK’ÿ: identificateur introuvable<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(34): error C3861: 'AT_CHECK’ÿ: identificateur introuvable<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(35): error C3861: 'AT_CHECK’ÿ: identificateur introuvable<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(33): warning C4996: ‘at::Tensor::type’: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(34): warning C4996: ‘at::Tensor::type’: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(35): warning C4996: ‘at::Tensor::type’: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(61): error C3861: 'AT_CHECK’ÿ: identificateur introuvable<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(62): error C3861: 'AT_CHECK’ÿ: identificateur introuvable<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(63): error C3861: 'AT_CHECK’ÿ: identificateur introuvable<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(61): warning C4996: ‘at::Tensor::type’: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(62): warning C4996: ‘at::Tensor::type’: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().<br>
C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\mmdet\ops\roi_align\src\roi_align_cuda.cpp(63): warning C4996: ‘at::Tensor::type’: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().<br>
ninja: build stopped: subcommand failed.<br>
Traceback (most recent call last):<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py”, line 1667, in _run_ninja_build<br>
subprocess.run(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\subprocess.py”, line 516, in run<br>
raise CalledProcessError(retcode, process.args,<br>
subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.</p>
<pre><code>The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
  File "C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py", line 217, in &lt;module&gt;
    setup(
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\develop.py", line 34, in run
    self.install_for_development()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\develop.py", line 136, in install_for_development
    self.run_command('build_ext')
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
    _build_ext.run(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 708, in build_extensions
    build_ext.build_extensions(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\distutils\command\build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 681, in win_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 1354, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\torch\utils\cpp_extension.py", line 1683, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
    return stream.closed
ValueError: underlying buffer has been detached
</code></pre>
<p>ERROR: Command errored out with exit status 1: ‘C:\ProgramData\Anaconda3\envs\SoloV2\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’; <strong>file</strong>=’"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(<strong>file</strong>);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, <strong>file</strong>, ‘"’"‘exec’"’"’))’ develop --no-deps Check the logs for full command output.<br>
Exception information:<br>
Traceback (most recent call last):<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\cli\base_command.py”, line 189, in <em>main<br>
status = self.run(options, args)<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\cli\req_command.py”, line 178, in wrapper<br>
return func(self, options, args)<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\commands\install.py”, line 391, in run<br>
installed = install_given_reqs(<br>
File "C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\req_<em>init</em></em>.py", line 80, in install_given_reqs<br>
requirement.install(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\req\req_install.py”, line 764, in install<br>
install_editable_legacy(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\operations\install\editable_legacy.py”, line 49, in install_editable<br>
call_subprocess(<br>
File “C:\ProgramData\Anaconda3\envs\SoloV2\lib\site-packages\pip_internal\utils\subprocess.py”, line 258, in call_subprocess<br>
raise InstallationSubprocessError(proc.returncode, command_desc)<br>
pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: ‘C:\ProgramData\Anaconda3\envs\SoloV2\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’; <strong>file</strong>=’"’"‘C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(<strong>file</strong>);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, <strong>file</strong>, ‘"’"‘exec’"’"’))’ develop --no-deps Check the logs for full command output.<br>
Removed build tracker: ‘C:\Users\MASTER\AppData\Local\Temp\pip-req-tracker-_obphhdg’</p>
<p>(SoloV2) C:\Users\MASTER\Desktop\installations SoloV2\SOLOv2-master2\SOLOv2-master&gt;</p>

ptrblck: <p>The new output is still showing the same error:</p>
<pre><code class="lang-python">error C3861: 'AT_CHECK’ÿ: identificateur introuvable
</code></pre>
<p>so you might need to change it to <code>TORCH_CHECK</code>.</p>

Sylvain_Ard: <p>ok thank you, I have seen the answer before</p>