HRNet-Semantic-Segmentation icon indicating copy to clipboard operation
HRNet-Semantic-Segmentation copied to clipboard

subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

Open WitGotFlg opened this issue 4 years ago • 17 comments

Thanks for your appealing work, but I encountered a problem when having a try on training your code. Here is the error informations: ` Frame skipped from debugging during step-in. Note: may have been skipped because of "justMyCode" option (default == true). F:\anaconda3\lib\site-packages\torch\utils\cpp_extension.py:184: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。 warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error)) Traceback (most recent call last): File "c:\Users\msi-pc.vscode\extensions\ms-python.python-2019.8.29288\pythonFiles\ptvsd_launcher.py", line 43, in main(ptvsdArgs) File "c:\Users\msi-pc.vscode\extensions\ms-python.python-2019.8.29288\pythonFiles\lib\python\ptvsd_main_.py", line 432, in main run() File "c:\Users\msi-pc.vscode\extensions\ms-python.python-2019.8.29288\pythonFiles\lib\python\ptvsd_main_.py", line 316, in run_file runpy.run_path(target, run_name='main') File "F:\anaconda3\lib\runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "F:\anaconda3\lib\runpy.py", line 96, in run_module_code mod_name, mod_spec, pkg_name, script_name) File "F:\anaconda3\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "f:\缩小版备份\研究生\19年暑假\HRNet-Semantic-Segmentation-master\tools\train.py", line 27, in import models File "f:\缩小版备份\研究生\19年暑假\HRNet-Semantic-Segmentation-master\tools..\lib\models_init.py", line 11, in import models.seg_hrnet File "f:\缩小版备份\研究生\19年暑假\HRNet-Semantic-Segmentation-master\tools..\lib\models\seg_hrnet.py", line 22, in from .sync_bn.inplace_abn.bn import InPlaceABNSync File "f:\缩小版备份\研究生\19年暑假\HRNet-Semantic-Segmentation-master\tools..\lib\models\sync_bn_init.py", line 1, in from .inplace_abn import bn File "f:\缩小版备份\研究生\19年暑假\HRNet-Semantic-Segmentation-master\tools..\lib\models\sync_bn\inplace_abn_init_.py", line 1, in from .bn import ABN, InPlaceABN, InPlaceABNSync File "f:\缩小版备份\研究生\19年暑假\HRNet-Semantic-Segmentation-master\tools..\lib\models\sync_bn\inplace_abn\bn.py", line 14, in from functions import * File "f:\缩小版备份\研究生\19年暑假\HRNet-Semantic-Segmentation-master\lib\models\sync_bn\inplace_abn\functions.py", line 16, in extra_cuda_cflags=["--expt-extended-lambda"]) File "F:\anaconda3\lib\site-packages\torch\utils\cpp_extension.py", line 644, in load is_python_module) File "F:\anaconda3\lib\site-packages\torch\utils\cpp_extension.py", line 813, in _jit_compile with_cuda=with_cuda) File "F:\anaconda3\lib\site-packages\torch\utils\cpp_extension.py", line 862, in _write_ninja_file_and_build with_cuda=with_cuda) File "F:\anaconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1072, in _write_ninja_file 'cl']).decode().split('\r\n') File "F:\anaconda3\lib\subprocess.py", line 336, in check_output **kwargs).stdout File "F:\anaconda3\lib\subprocess.py", line 418, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

` How can I fix this problem? ( My pytorch version is 1.1.0, cuda is 9.0) Looking forward to your reply.

WitGotFlg avatar Aug 07 '19 09:08 WitGotFlg

i have also the problem , how ?

zhangyunming avatar Sep 06 '19 06:09 zhangyunming

Same problem, not solved yet

1023198294 avatar Oct 17 '19 07:10 1023198294

I faced the same problem on windows system, and I solved it through setting environment variables. Please see more details in https://thebadzhang.github.io/Blog/17/04/CL_CL_VS17.html.

shuangshuangguo avatar Jan 14 '20 03:01 shuangshuangguo

Traceback (most recent call last): File "eval.py", line 185, in main() File "eval.py", line 86, in main model = neurvps.models.VanishingNet( File "C:\Users\Dimple\neurvps\neurvps\models\vanishing_net.py", line 23, in init self.anet = ApolloniusNet(output_stride, upsample_scale) File "C:\Users\Dimple\neurvps\neurvps\models\vanishing_net.py", line 90, in init self.conv00 = ConicConv(32, 32) File "C:\Users\Dimple\neurvps\neurvps\models\conic.py", line 12, in init self.deform_conv = DeformConv( File "C:\Users\Dimple\neurvps\neurvps\models\deformable.py", line 132, in init DCN = load_cpp_ext("DCN") File "C:\Users\Dimple\neurvps\neurvps\models\deformable.py", line 24, in load_cpp_ext ext = load( File "C:\Users\Dimple\anaconda3\envs\neurvps\lib\site-packages\torch\utils\cpp_extension.py", line 986, in load return _jit_compile( File "C:\Users\Dimple\anaconda3\envs\neurvps\lib\site-packages\torch\utils\cpp_extension.py", line 1193, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\Dimple\anaconda3\envs\neurvps\lib\site-packages\torch\utils\cpp_extension.py", line 1285, in _write_ninja_file_and_build_library _write_ninja_file_to_build_library( File "C:\Users\Dimple\anaconda3\envs\neurvps\lib\site-packages\torch\utils\cpp_extension.py", line 1679, in _write_ninja_file_to_build_library _write_ninja_file( File "C:\Users\Dimple\anaconda3\envs\neurvps\lib\site-packages\torch\utils\cpp_extension.py", line 1790, in _write_ninja_file cl_paths = subprocess.check_output(['where', File "C:\Users\Dimple\anaconda3\envs\neurvps\lib\subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\Dimple\anaconda3\envs\neurvps\lib\subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

Got this error while working on this project: https://github.com/zhou13/neurvps Please help us resolve it ASAP

twister1606 avatar Dec 30 '20 10:12 twister1606

Have you solve this problem?

ljl913479576 avatar Jan 27 '21 11:01 ljl913479576

Hi. For this to work you have to make sure that cl command can be called from your prompt. This and this shows solutions for windows 10. But the easiest workaround I found is just add cl.exe dir path to the environmental variables. Default path is "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.22.27905\bin...". choose the right one accordingly to your architecture.

JotaCe7 avatar Apr 04 '21 03:04 JotaCe7

For few of us who cannot read Chinese :

  1. Add two paths to the Path item in the environment variable (remember to add a semicolon): E:\VS2017\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64; E:\VS2017\Common7\IDE The first line is the directory of the compiler, choose it according to the computer, but at least HostX86\x86 is available for all platforms, and the 64-bit system is filled in as in the example

  2. Create a new LIB variable in the environment variable and add three paths (remember to add a semicolon): C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\lib\x64; C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\ucrt\x86; C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86; The first path is the lib path, if HostX64\x64 is filled in the path variable, then x64 lib is used I don’t know if the second path is filled in, but if I fill in the latest version, no problem is found so far.

  3. Create a new INCLUDE variable in the environment variable and add two paths (remember to add a semicolon): E:\VS2017\VC\Tools\MSVC\14.10.25017\include; C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt; The second path corresponds to the second path above

  4. Click the batch program vcvarall.bat in the path E:\VS2017\VC\Auxiliary\Build. Then open the command line, enter cl, if no error is reported, the configuration is successful...

mohammadrezanaderi4 avatar Dec 01 '21 19:12 mohammadrezanaderi4

@mohammadrezanaderi4 thank you! problem solved!

bmquynhlinh avatar Feb 10 '22 22:02 bmquynhlinh

@mohammadrezanaderi4 thanks for your solution

but did not fully work for me on windows 10. after I removed the semicolon* and ran the bat as follows:

vcvarsall.bat x86_amd64

then I could run 'cl' in a new command prompt successfully.

*semicolon problem for windows 10 mentioned here: https://stackoverflow.com/questions/8756828/visual-studio-command-prompt-gives-common-was-unexpected-at-this-time

FilipeF12 avatar Feb 22 '22 05:02 FilipeF12

For few of us who cannot read Chinese :

  1. Add two paths to the Path item in the environment variable (remember to add a semicolon): E:\VS2017\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64; E:\VS2017\Common7\IDE The first line is the directory of the compiler, choose it according to the computer, but at least HostX86\x86 is available for all platforms, and the 64-bit system is filled in as in the example
  2. Create a new LIB variable in the environment variable and add three paths (remember to add a semicolon): C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\lib\x64; C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\ucrt\x86; C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86; The first path is the lib path, if HostX64\x64 is filled in the path variable, then x64 lib is used I don’t know if the second path is filled in, but if I fill in the latest version, no problem is found so far.
  3. Create a new INCLUDE variable in the environment variable and add two paths (remember to add a semicolon): E:\VS2017\VC\Tools\MSVC\14.10.25017\include; C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt; The second path corresponds to the second path above
  4. Click the batch program vcvarall.bat in the path E:\VS2017\VC\Auxiliary\Build. Then open the command line, enter cl, if no error is reported, the configuration is successful...

I use Visual Studio Code does someone have the Paths for VSCode?

MationPlays avatar Mar 02 '22 15:03 MationPlays

For few of us who cannot read Chinese :

  1. Add two paths to the Path item in the environment variable (remember to add a semicolon): E:\VS2017\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64; E:\VS2017\Common7\IDE The first line is the directory of the compiler, choose it according to the computer, but at least HostX86\x86 is available for all platforms, and the 64-bit system is filled in as in the example
  2. Create a new LIB variable in the environment variable and add three paths (remember to add a semicolon): C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\lib\x64; C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\ucrt\x86; C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86; The first path is the lib path, if HostX64\x64 is filled in the path variable, then x64 lib is used I don’t know if the second path is filled in, but if I fill in the latest version, no problem is found so far.
  3. Create a new INCLUDE variable in the environment variable and add two paths (remember to add a semicolon): E:\VS2017\VC\Tools\MSVC\14.10.25017\include; C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt; The second path corresponds to the second path above
  4. Click the batch program vcvarall.bat in the path E:\VS2017\VC\Auxiliary\Build. Then open the command line, enter cl, if no error is reported, the configuration is successful...

I use Visual Studio Code does someone have the Paths for VSCode?

did you find a solution please , I am stuck in this error ?

JomanaWael14 avatar Apr 28 '22 10:04 JomanaWael14

hello thank you for your solution. but I don't know how to implement for solve this problem I'm working on RGBD Semantic Segmentation I'm still stuck. please explain me well. thanks for your time

claus25 avatar May 03 '22 18:05 claus25

'pwd' is not recognized as an internal or external command, operable program or batch file. C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py:317: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\model\SA-Gate.nyu.432\train.py", line 22, in from furnace.seg_opr.sync_bn.parallel import DataParallelModel, Reduce File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn_init_.py", line 8, in from furnace.seg_opr.sync_bn.syncbn import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\syncbn.py", line 17, in from furnace.seg_opr.sync_bn.functions import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\functions.py", line 13, in from furnace.seg_opr.sync_bn.src import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\src_init_.py", line 11, in cpu = load('syncbn_cpu', [ File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1125, in load return _jit_compile( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1338, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1437, in _write_ninja_file_and_build_library _write_ninja_file_to_build_library( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1876, in _write_ninja_file_to_build_library _write_ninja_file( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 2000, in _write_ninja_file cl_paths = subprocess.check_output(['where', File "C:\Users\claus\miniconda3\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\claus\miniconda3\lib\subprocess.py", line 531, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

this is the error

claus25 avatar May 03 '22 18:05 claus25

oohh I forgot. I have MSV2022

claus25 avatar May 03 '22 18:05 claus25

'pwd' is not recognized as an internal or external command, operable program or batch file. C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py:317: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\model\SA-Gate.nyu.432\train.py", line 22, in from furnace.seg_opr.sync_bn.parallel import DataParallelModel, Reduce File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn__init__.py", line 8, in from furnace.seg_opr.sync_bn.syncbn import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\syncbn.py", line 17, in from furnace.seg_opr.sync_bn.functions import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\functions.py", line 13, in from furnace.seg_opr.sync_bn.src import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\src__init__.py", line 11, in cpu = load('syncbn_cpu', [ File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1125, in load return _jit_compile( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1338, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1437, in _write_ninja_file_and_build_library _write_ninja_file_to_build_library( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1876, in _write_ninja_file_to_build_library _write_ninja_file( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 2000, in _write_ninja_file cl_paths = subprocess.check_output(['where', File "C:\Users\claus\miniconda3\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\claus\miniconda3\lib\subprocess.py", line 531, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

this is the error

do you find a solution, I also encounter this problem

Latias201 avatar Feb 14 '23 13:02 Latias201

 

sorry, no  

Sent: Tuesday, February 14, 2023 at 7:47 AM From: "Latias201" @.> To: "HRNet/HRNet-Semantic-Segmentation" @.> Cc: "FilipeF12" @.>, "Comment" @.> Subject: Re: [HRNet/HRNet-Semantic-Segmentation] subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1. (#39)

 

'pwd' is not recognized as an internal or external command, operable program or batch file. C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py:317: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\model\SA-Gate.nyu.432\train.py", line 22, in from furnace.seg_opr.sync_bn.parallel import DataParallelModel, Reduce File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn__init__.py", line 8, in from furnace.seg_opr.sync_bn.syncbn import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\syncbn.py", line 17, in from furnace.seg_opr.sync_bn.functions import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\functions.py", line 13, in from furnace.seg_opr.sync_bn.src import * File "D:\courses\machine learning\RGBD_Semantic_Segmentation_PyTorch-master\furnace\seg_opr\sync_bn\src__init__.py", line 11, in cpu = load('syncbn_cpu', [ File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1125, in load return _jit_compile( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1338, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1437, in _write_ninja_file_and_build_library _write_ninja_file_to_build_library( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 1876, in _write_ninja_file_to_build_library _write_ninja_file( File "C:\Users\claus\miniconda3\lib\site-packages\torch\utils\cpp_extension.py", line 2000, in _write_ninja_file cl_paths = subprocess.check_output(['where', File "C:\Users\claus\miniconda3\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\claus\miniconda3\lib\subprocess.py", line 531, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

this is the error

do you find a solution, I also encounter this problem

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

FilipeF12 avatar Feb 27 '23 22:02 FilipeF12

I have encountered this problem(on Windows) in other python project. In my case, I solved it by

  1. change OS like ubuntu. WSL works in my situation. or
  2. run python code in "x64 Native Tools Command Prompt for VS 2019" which comes from Visual Studio 2019. or
  3. Add "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86" into "Path" of your environment variables.

j71200 avatar Jan 30 '24 06:01 j71200