Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows10进行python setup.py develop 报错 #508

Open
aniseanise opened this issue Dec 12, 2022 · 7 comments
Open

Windows10进行python setup.py develop 报错 #508

aniseanise opened this issue Dec 12, 2022 · 7 comments

Comments

@aniseanise
Copy link

error: command 'cl.exe' failed: None

@aniseanise
Copy link
Author

(Py39_Torch1.10_cu11.3) D:\py\yolov5_obb\utils\nms_rotated>python setup.py develop
running develop
G:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
G:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
writing nms_rotated.egg-info\PKG-INFO
writing dependency_links to nms_rotated.egg-info\dependency_links.txt
writing top-level names to nms_rotated.egg-info\top_level.txt
G:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\torch\utils\cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'nms_rotated.egg-info\SOURCES.txt'
writing manifest file 'nms_rotated.egg-info\SOURCES.txt'
running build_ext
G:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\torch\utils\cpp_extension.py:346: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building '.nms_rotated_ext' extension
cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IG:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\torch\include -IG:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\torch\include\torch\csrc\api\include -IG:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\torch\include\TH -IG:\anaconda3\envs\Py39_Torch1.10_cu11.3\lib\site-packages\torch\include\THC "-IG:\Program Files\cuda_\include" -IG:\anaconda3\envs\Py39_Torch1.10_cu11.3\include -IG:\anaconda3\envs\Py39_Torch1.10_cu11.3\Include /EHsc /Tpsrc/nms_rotated_cpu.cpp /Fobuild\temp.win-amd64-cpython-39\Release\src/nms_rotated_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_rotated_ext -D_GLIBCXX_USE_CXX11_ABI=0
error: command 'cl.exe' failed: None

@aniseanise
Copy link
Author

解决办法:
1.再次核对cuda版本 cuda11.3安装命令:conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
2.这是python和c++混编的项目,提前pip install ninja;另外要安装VS2017
3.requirement文档里scipy包的安装:https://blog.csdn.net/qq_39521554/article/details/79929558
4.python setup.py develop报错:两个eps报错,在\yolov5_obb\utils\nms_rotated\src\poly_nms_cuda.cu里将两个eps用1E-8代替

@aniseanise
Copy link
Author

仍有问题没有解决。
上述完成后出现:
Installed d:\py\yolov5_obb\utils\nms_rotated
Processing dependencies for nms-rotated==0.0.0
Finished processing dependencies for nms-rotated==0.0.0

另外上述结果是仍进行了大量循环之后的结果:
.....
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514): note: 参见对正在编译的 类 模板 实例化 "std::is_copy_constructible<c10::trivially_copyable_optimization_optional_base>" 的引用
with
[
T=c10::QualifiedName
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(526): note: 参见对正在编译的 别名 模板 实例化 "c10::OptionalBasec10::QualifiedName" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\ATen/core/jit_type.h(990): note: 参见对正在编译的 类 模板 实例化 "c10::optionalc10::QualifiedName" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(418): warning C4624: “c10::trivially_copyable_optimization_optional_base”: 已将析构函数隐式定义为“已删除”
with
[
T=c10::QualifiedName
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: “c10::constexpr_storage_t”: 已将析构函 数隐式定义为“已删除”
with
[
T=torch::autograd::ViewInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(383): note: 参见对正在编译的 类 模板 实例化 "c10::constexpr_storage_t" 的引用
with
[
T=torch::autograd::ViewInfo
]
D:\Program Files (x86)\VS2017\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\type_traits(842): note: 参见对正在编译的 类 模板 实例化 "c10::trivially_copyable_optimization_optional_base" 的引用
with
[
T=torch::autograd::ViewInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514): note: 参见对正在编译的 类 模板 实例化 "std::is_copy_constructible<c10::trivially_copyable_optimization_optional_base>" 的引用
with
[
T=torch::autograd::ViewInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(526): note: 参见对正在编译的 别名 模板 实例化 "c10::OptionalBasetorch::autograd::ViewInfo" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\torch/csrc/autograd/variable.h(525): note: 参见对正在编译的 类 模板 实例化 "c10::optionaltorch::autograd::ViewInfo" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(418): warning C4624: “c10::trivially_copyable_optimization_optional_base”: 已将析构函数隐式定义为“已删除”
with
[
T=torch::autograd::ViewInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: “c10::constexpr_storage_t”: 已将析构函 数隐式定义为“已删除”
with
[
T=c10::IValue
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(383): note: 参见对正在编译的 类 模板 实例化 "c10::constexpr_storage_t" 的引用
with
[
T=c10::IValue
]
D:\Program Files (x86)\VS2017\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\type_traits(842): note: 参见对正在编译的 类 模板 实例化 "c10::trivially_copyable_optimization_optional_base" 的引用
with
[
T=c10::IValue
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514): note: 参见对正在编译的 类 模板 实例化 "std::is_copy_constructible<c10::trivially_copyable_optimization_optional_base>" 的引用
with
[
T=c10::IValue
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(526): note: 参见对正在编译的 别名 模板 实例化 "c10::OptionalBasec10::IValue" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\ATen/core/function_schema.h(124): note: 参见对正在编译的 类 模板 实例化 "c10::optionalc10::IValue" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(418): warning C4624: “c10::trivially_copyable_optimization_optional_base”: 已将析构函数隐式定义为“已删除”
with
[
T=c10::IValue
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: “c10::constexpr_storage_t”: 已将析构函 数隐式定义为“已删除”
with
[
T=c10::AliasInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(383): note: 参见对正在编译的 类 模板 实例化 "c10::constexpr_storage_t" 的引用
with
[
T=c10::AliasInfo
]
D:\Program Files (x86)\VS2017\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\type_traits(842): note: 参见对正在编译的 类 模板 实例化 "c10::trivially_copyable_optimization_optional_base" 的引用
with
[
T=c10::AliasInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514): note: 参见对正在编译的 类 模板 实例化 "std::is_copy_constructible<c10::trivially_copyable_optimization_optional_base>" 的引用
with
[
T=c10::AliasInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(526): note: 参见对正在编译的 别名 模板 实例化 "c10::OptionalBasec10::AliasInfo" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\ATen/core/function_schema.h(125): note: 参见对正在编译的 类 模板 实例化 "c10::optionalc10::AliasInfo" 的引用
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(418): warning C4624: “c10::trivially_copyable_optimization_optional_base”: 已将析构函数隐式定义为“已删除”
with
[
T=c10::AliasInfo
]
G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: “c10::constexpr_storage_t”: 已将析构函 数隐式定义为“已删除”
with
[
T=std::tuple<std::s
..........
.........

@CCCCchu
Copy link

CCCCchu commented Dec 19, 2022

File "E:\Anaconda\envs\yobb\lib\site-packages\torch\utils\cpp_extension.py", line 1735, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
出现了这个问题

@ibtehajali67
Copy link

There are still issues unresolved. After the above is completed: Installed d:\py\yolov5_obb\utils\nms_rotated Processing dependencies for nms-rotated==0.0.0 Finished processing dependencies for nms-rotated==0.0.0

In addition, the above results are the results after a large number of cycles: ..... G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514): note: See reference to class template instantiation "std::is_copy_constructiblec10::trivially_copyable_optimization_optional_base" being compiled with [ T=c10::QualifiedName ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include \c10/util/Optional.h(526): note: See reference to alias template instantiation "c10::OptionalBasec10::QualifiedName" being compiled G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch \include\ATen/core/jit_type.h(990): note: See reference to class template instantiation "c10::optionalc10::QualifiedName" being compiled G:\anaconda3\envs\yolov5_obb\lib\site-packages \torch\include\c10/util/Optional.h(418): warning C4624: “c10::trivially_copyable_optimization_optional_base”:Destructor implicitly defined as 'deleted' with [ T=c10::QualifiedName ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: “c10::constexpr_storage_t”: already Implicitly define destructor as "deleted" with [ T=torch::autograd::ViewInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h (383): note: See reference to class template instantiation "c10::constexpr_storage_t" being compiled with [ T=torch::autograd::ViewInfo ] D:\Program Files (x86)\VS2017\Microsoft Visual Studio\ 2017\Community\VC\Tools\MSVC\14.16.27023\include\type_traits(842): note: See reference to class template instantiation "c10::trivially_copyable_optimization_optional_base" being compiled with [ T=torch::autograd::ViewInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514): note: see class template instance being compiled reference to "std::is_copy_constructiblec10::trivially_copyable_optimization_optional_base" with [ T=torch::autograd::ViewInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/ Optional.h(526): note: See reference to alias template instantiation "c10::OptionalBasetorch::autograd::ViewInfo" being compiled G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include \torch/csrc/autograd/variable.h(525): note: see reference to class template instantiation "c10::optionaltorch::autograd::ViewInfo" being compiled G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(418): warning C4624: "c10::trivially_copyable_optimization_optional_base": destructor implicitly defined as " Removed" with [ T=torch::autograd::ViewInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: "c10 ::constexpr_storage_t': implicitly defined destructor as 'deleted' with [ T=c10::IValue ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/ Optional.h(383): note: see reference to class template instantiation "c10::constexpr_storage_t" being compiled with [ T=c10::IValue ] D:\Program Files (x86)\VS2017\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\type_traits(842): note: See instantiating a class template being compiled"c10: Reference to :trivially_copyable_optimization_optional_base" with [ T=c10::IValue ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514): note: see Compiling Reference to class template instantiation of "std::is_copy_constructiblec10::trivially_copyable_optimization_optional_base" with [ T=c10::IValue ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util /Optional.h(526): note: see reference to alias template instantiation "c10::OptionalBasec10::IValue" being compiled G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\ATen/core/function_schema.h(124): note: See instantiating "c10::optionalc10::IValue" for the class template being compiled Reference G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(418): warning C4624: "c10::trivially_copyable_optimization_optional_base": the destructor has been implicitly defined is "removed" with [ T=c10::IValue ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: “c10: :constexpr_storage_t': Destructor implicitly defined as 'deleted' with [ T=c10::AliasInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional .h(383): note: see reference to class template instantiation "c10::constexpr_storage_t" being compiled with [ T=c10::AliasInfo ] D:\Program Files (x86)\VS2017\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\type_traits(842): note: See reference to compiling Reference to class template instantiation "c10::trivially_copyable_optimization_optional_base" with [ T=c10::AliasInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(514) : note: See reference to class template instantiation "std::is_copy_constructiblec10::trivially_copyable_optimization_optional_base" being compiled with [ T=c10::AliasInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\ torch\include\c10/util/Optional.h(526): note: See reference to instantiation of alias template "c10::OptionalBasec10::AliasInfo" being compiled G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\ATen/core/function_schema.h(125): note: See instantiating "c10::optionalc10::AliasInfo" for the class template being compiled Reference G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(418): warning C4624: "c10::trivially_copyable_optimization_optional_base": the destructor has been implicitly defined "Removed" with [ T=c10::AliasInfo ] G:\anaconda3\envs\yolov5_obb\lib\site-packages\torch\include\c10/util/Optional.h(184): warning C4624: “c10: :constexpr_storage_t': destructor implicitly defined as 'deleted' with [ T =std::tuple<std::s ..........................................

i am also facing that issue

@peng30025
Copy link

File "E:\Anaconda\envs\yobb\lib\site-packages\torch\utils\cpp_extension.py", line 1735, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error compiling objects for extension 出现了这个问题

I have the same problem, how can you fix it?

@goodfishboy
Copy link

解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants