zhanghang1989 / PyTorch-Encoding

A CV toolkit for my papers.
https://hangzhang.org/PyTorch-Encoding/
MIT License
2.04k stars 450 forks source link

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

Closed flyingshan closed 4 years ago

flyingshan commented 5 years ago

Warning (from warnings module): File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\cpp_extension.py", line 184 warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error)) UserWarning: Error checking compiler version for c++: Command 'c++' returned non-zero exit status 1. Traceback (most recent call last): File "<pyshell#0>", line 1, in import encoding File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\encoding__init.py", line 13, in from . import nn, functions, parallel, utils, models, datasets, transforms File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\encoding\nn\init.py", line 12, in from .encoding import * File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\encoding\nn\encoding.py", line 18, in from ..functions import scaled_l2, aggregate, pairwise_cosine File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\encoding\functions\init.py", line 2, in from .encoding import * File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\encoding\functions\encoding.py", line 14, in from .. import lib File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\encoding\lib\init__.py", line 15, in ], build_directory=cpu_path, verbose=False) File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\cpp_extension.py", line 645, in load is_python_module) File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\cpp_extension.py", line 814, in _jit_compile with_cuda=with_cuda) File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\cpp_extension.py", line 859, in _write_ninja_file_and_build with_cuda=with_cuda) File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\utils\cpp_extension.py", line 1064, in _write_ninja_file 'cl']).decode().split('\r\n') File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 336, in check_output **kwargs).stdout File "C:\Users\ys\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 418, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

After i install the latest version of encoding, this error will still occur when i import encoding module. I use python3.6, pytorch1.0 stable, cuda9.0

zhanghang1989 commented 5 years ago

sorry about the error you have. I am not good at system debugging. Could you try using anaconda 3.6?

flyingshan commented 5 years ago

sorry about the error you have. I am not good at system debugging. Could you try using anaconda 3.6?

I have tried anaconda5.2(python3.6), but still encountered this problem...

OilGao commented 5 years ago

sorry about the error you have. I am not good at system debugging. Could you try using anaconda 3.6?

I have tried anaconda5.2(python3.6), but still encountered this problem...

Hello, can you solve this problem?

Chenfeng1271 commented 5 years ago

Does the problem only happen on Win, not for Ubuntu?

developpeur3d commented 5 years ago

I have the same problem , win64, all packages are updated. (24/04/2019)

opee007 commented 5 years ago

Hello, can you solve this problem?

FreakChan commented 5 years ago

Met the same problem. Does it have any solution?

FreakChan commented 5 years ago

win7, torch-encoding==1.0.0, python==3.7, pytorch==1.2stable

douysu commented 4 years ago

i also meet the problem......but my question is ['which', 'c++'] in docker

debvrat commented 4 years ago

Same issue. Windows 10, 64 bit. Conda 4.8.3, pytorch 1.4

zhanghang1989 commented 4 years ago

Sorry that I don't have experience using Windows.

I can help on ubuntu or mac os.

debvrat commented 4 years ago

Sorry that I don't have experience using Windows.

I can help on ubuntu or mac os.

Similar issue for macOS 10.15.4:

Traceback (most recent call last):
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1066, in _build_extension_module
    check=True)
  File "/Users/akv/anaconda3/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 17, in <module>
    import encoding.utils as utils
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/__init__.py", line 14, in <module>
    from . import nn, functions, dilated, parallel, utils, datasets
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/nn/__init__.py", line 12, in <module>
    from .encoding import *
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/nn/encoding.py", line 18, in <module>
    from ..functions import scaled_l2, aggregate, pairwise_cosine
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/functions/__init__.py", line 2, in <module>
    from .encoding import *
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/functions/encoding.py", line 14, in <module>
    from .. import lib
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/__init__.py", line 15, in <module>
    ], build_directory=cpu_path, verbose=False)
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 680, in load
    is_python_module)
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 866, in _jit_compile
    with_cuda=with_cuda)
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 919, in _write_ninja_file_and_build
    _build_extension_module(name, build_directory, verbose)
  File "/Users/akv/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1079, in _build_extension_module
    raise RuntimeError(message)
RuntimeError: Error building extension 'enclib_cpu': [1/6] x86_64-apple-darwin13.4.0-clang++ -MMD -MF syncbn_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/syncbn_cpu.cpp -o syncbn_cpu.o
FAILED: syncbn_cpu.o 
x86_64-apple-darwin13.4.0-clang++ -MMD -MF syncbn_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/syncbn_cpu.cpp -o syncbn_cpu.o
/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/syncbn_cpu.cpp:1:10: fatal error: 'torch/tensor.h' file not found
#include <torch/tensor.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
[2/6] x86_64-apple-darwin13.4.0-clang++ -MMD -MF nms_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/nms_cpu.cpp -o nms_cpu.o
FAILED: nms_cpu.o 
x86_64-apple-darwin13.4.0-clang++ -MMD -MF nms_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/nms_cpu.cpp -o nms_cpu.o
/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/nms_cpu.cpp:1:10: fatal error: 'torch/tensor.h' file not found
#include <torch/tensor.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
[3/6] x86_64-apple-darwin13.4.0-clang++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o
FAILED: roi_align_cpu.o 
x86_64-apple-darwin13.4.0-clang++ -MMD -MF roi_align_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/roi_align_cpu.cpp -o roi_align_cpu.o
/Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/roi_align_cpu.cpp:1:10: fatal error: 'torch/tensor.h' file not found
#include <torch/tensor.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
[4/6] x86_64-apple-darwin13.4.0-clang++ -MMD -MF encoding_cpu.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/encoding_cpu.cpp -o encoding_cpu.o
[5/6] x86_64-apple-darwin13.4.0-clang++ -MMD -MF operator.o.d -DTORCH_EXTENSION_NAME=enclib_cpu -DTORCH_API_INCLUDE_EXTENSION_H -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /Users/akv/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /Users/akv/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /Users/akv/anaconda3/lib/python3.7/site-packages/encoding/lib/cpu/operator.cpp -o operator.o
ninja: build stopped: subcommand failed.
zhanghang1989 commented 4 years ago

Are you using an old version of pytorch?

debvrat commented 4 years ago

Are you using an old version of pytorch?

Nope. I'm using 1.4.0, the latest. On both Windows and Mac

zhanghang1989 commented 4 years ago

That sounds frustrating. I will provide docker container later. Please check out later if you are still interested in this repo.

debvrat commented 4 years ago

That sounds frustrating. I will provide docker container later. Please check out later if you are still interested in this repo.

Great. Thanks. Will do

zhanghang1989 commented 4 years ago

docker is provided at https://github.com/zhanghang1989/PyTorch-Encoding/pull/305

twister1606 commented 3 years ago

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

zhanghang1989 commented 3 years ago

The code you are using is from other repo.

Please use our latest code. Thx