Comments (11)
I've "solved" the problem
when I seach the whole torch folder, it shows that there's only one DEPTH_LIMIT, so I just comment the (161) line where error raised in ...torch/include\torch/csrc/jit/argument_spec.h
and when I compiled it again, it shows another error:
<env_lib_dir>\site-packages\torch\lib\include\pybind11\cast.h(1393): error: expression must be a pointer to a complete object type
then I followed someone's solution
go straight into the cast.h file and make the following changes
replace explicit operator type&() { return *(this->value); }
with
explicit operator type& () { *((type*)(this->value)); }
and it finally worked.
from extension-cpp.
I also encountered this problem. How did you solve it?
from extension-cpp.
This should be fixed now by pytorch/pytorch#33002
from extension-cpp.
@mdcramer the fix was landed after the 1.4.0 branch was cut. It will be present in either the nightly build or the 1.5.0 release, when that happens
from extension-cpp.
I got the same error.
I tried a lot to fix this but couldn't debug the errors.
How to fix this error?
Please help!!
Thanks
from extension-cpp.
I also get the error with jit and CUDA v10.0 when running /cuda/setup.py
.
I'd very much like to know the solution to this problem.
OS: Windows 10
PyTorch version: 1.1.0
How you installed PyTorch (conda, pip, source): conda
Python version: 3.7.3
CUDA/cuDNN version: 10.0/7.6.0
GPU models and configuration: RTX 2070
GCC version (if compiling from source): 8.2.0
from extension-cpp.
@Xieyuan0018 @wantsjean Hi, Im encountering the same file compilation error :
1 error detected in the compilation of "C:/Users/XIEYUA~1/AppData/Local/Temp/tmpxft_00002f00_00000000-10_lltm_cuda_kernel.cpp1.ii".
error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe' failed with exit status 1
Except minus the first part - my error doesnt point me to the Depth variable prior to the error, instead I get this:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe -c C:\projects\pytorch\pytorch\detectron2\detectron2\layers\csrc\deformable\deform_conv_cuda.cu -o build\temp.win-amd64-3.7\Release\projects\pytorch\pytorch\detectron2\detectron2\layers\csrc\deformable\deform_conv_cuda.obj -IC:\projects\pytorch\pytorch\detectron2\detectron2\layers\csrc -IC:\Users\aesnj\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\include -IC:\Users\aesnj\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\aesnj\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\include\TH -IC:\Users\aesnj\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\Users\aesnj\AppData\Local\Programs\Python\Python37\include -IC:\Users\aesnj\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" -Xcompiler /EHsc -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75
deform_conv_cuda.cu
I did implement the changes mentioned above for argument_spec and cost.h files in case and tried another clone version of detectron2 : facebookresearch/detectron2#9 , same error.
Can I ask if you guys have used Conda or straight python? I use Admin VS 2019 tools command prompt which initializes correctly, and when testing my nvcc build, it seems to be ok. Am trying Conda now but am wondering if I can isolate the issue and not depend on conda?
from extension-cpp.
I have Pytorch 1.4.0 installed, and have updated everything else, and I'm still getting torch/csrc/jit/argument_spec.h(190): error: member "torch::jit::ArgumentSpecCreator::DEPTH_LIMIT" may not be initialized
.
I did, however, comment out line 190 in argument_spec.h
and the error disappeared.
Update: I read at facebookresearch/detectron2#9 (comment) that line 190 should be changed to static const size_t DEPTH_LIMIT = 128;
, so I did that and it seems like this error is gone.
from extension-cpp.
Hi
I am intalling Detectron2 in Windows10 , when I run python setup.py install I am getting this error .Please help me out
Microsoft Visual Studio 2019
pytorch 1.5
cuda 10.1
Traceback (most recent call last):
File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 1400, in _run_ninja_build
check=True)
File "D:\anaconda\envs\detectron_project\lib\subprocess.py", line 438, 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 "setup.py", line 115, in
cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools_init_.py", line 165, in setup
return distutils.core.setup(**attrs)
File "D:\anaconda\envs\detectron_project\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "D:\anaconda\envs\detectron_project\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\bdist_egg.py", line 174, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\bdist_egg.py", line 160, in call_command
self.run_command(cmdname)
File "D:\anaconda\envs\detectron_project\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "D:\anaconda\envs\detectron_project\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "D:\anaconda\envs\detectron_project\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "D:\anaconda\envs\detectron_project\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 580, in build_extensions
build_ext.build_extensions(self)
File "D:\anaconda\envs\detectron_project\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\build_ext.py", line 208, in build_extension
_build_ext.build_extension(self, ext)
File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 533, in build_extension
depends=ext.depends)
File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 562, in win_wrap_ninja_compile
with_cuda=with_cuda)
File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects
error_prefix='Error compiling objects for extension')
File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 1413, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error compiling objects for extension
from extension-cpp.
Hi I am intalling Detectron2 in Windows10 , when I run python setup.py install I am getting this error .Please help me out
Microsoft Visual Studio 2019 pytorch 1.5 cuda 10.1
Traceback (most recent call last): File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 1400, in _run_ninja_build check=True) File "D:\anaconda\envs\detectron_project\lib\subprocess.py", line 438, 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 "setup.py", line 115, in cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension}, File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools__init__.py", line 165, in setup return distutils.core.setup(**attrs) File "D:\anaconda\envs\detectron_project\lib\distutils\core.py", line 148, in setup dist.run_commands() File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 955, in run_commands self.run_command(cmd) File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\install.py", line 67, in run self.do_egg_install() File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "D:\anaconda\envs\detectron_project\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\bdist_egg.py", line 174, in run cmd = self.call_command('install_lib', warn_dir=0) File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\bdist_egg.py", line 160, in call_command self.run_command(cmdname) File "D:\anaconda\envs\detectron_project\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\install_lib.py", line 11, in run self.build() File "D:\anaconda\envs\detectron_project\lib\distutils\command\install_lib.py", line 107, in build self.run_command('build_ext') File "D:\anaconda\envs\detectron_project\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "D:\anaconda\envs\detectron_project\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\build_ext.py", line 87, in run _build_ext.run(self) File "D:\anaconda\envs\detectron_project\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 580, in build_extensions build_ext.build_extensions(self) File "D:\anaconda\envs\detectron_project\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "D:\anaconda\envs\detectron_project\lib\site-packages\setuptools\command\build_ext.py", line 208, in build_extension _build_ext.build_extension(self, ext) File "D:\anaconda\envs\detectron_project\lib\distutils\command\build_ext.py", line 533, in build_extension depends=ext.depends) File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 562, in win_wrap_ninja_compile with_cuda=with_cuda) File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects error_prefix='Error compiling objects for extension') File "D:\anaconda\envs\detectron_project\lib\site-packages\torch\utils\cpp_extension.py", line 1413, in _run_ninja_build raise RuntimeError(message) RuntimeError: Error compiling objects for extension
Still having this same issue. No down-grading seems to help.
from extension-cpp.
If anyone else has the same problem, I wrote about it on https://discuss.pytorch.org/t/can-seemingly-not-build-cpp-cuda-extensions-for-any-version-of-pytorch-cudatoolkit/135073/2
This was actually an error with Visual Stuio being installed incorrectly. I uninstalled all Vsiual Studio components, removed the environtment variables (named ones and from Path), and removed all files on my disk. Then I installed VS 2019 (As that is the latest supported version by PyTorch as of making this post) and installed the C++ dev tools (SDK, build tools) with it. I then had to re-install Pytorch in conda (conda uninstall pytorch torchvision torchaudio cudatoolkit) and then installed them again, simply replacing the existing packages did not work.
After all this, it finally worked.
from extension-cpp.
Related Issues (20)
- www.facebook.com/rozi.khatun.961
- This repo can not compile using Pytorch 1.6.0 HOT 1
- This repo can not compile using Pytorch 1.6.0 HOT 1
- A question about backward propagation speed in cpp extension in tutorial
- Error when building cpp extension HOT 1
- AttributeError: module 'depthwise' has no attribute 'forward'
- cuda does not install HOT 17
- How does the layer of C++ extensions translate to TorchScript or onnx? HOT 1
- Cannot Unpack, Too Many Items
- How to debug in cuda-pytorch env?
- Writing a custom C++ extension with variants for both CPU and GPU? HOT 2
- Custom CUDA operator only work well on cuda:0 HOT 3
- How can I access data in cuda kernel like in pytorch?
- error LNK2001 undefined reference to `__cudaRegisterLinkedBinary
- Relation between at::Half and __half
- Deprecation warning
- Scikit-build-core / scikit-build support for binding
- `TORCH_LIBRARY` and `m.def` Not Working as Documented
- [feature request] Instruction on how to setup compile-env for Windows
- JIT-compiling the extension results in non-functional Python module.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from extension-cpp.