本人想要試試github上deformable kernel專案。按照README.md的步驟進行:
conda env create -f environment.yml
cd deformable_kernels/ops/deform_kernel;
pip install -e .;
deformable_kernels/ops/deform_kernel檔案夾的結構如下:
.
csrc
filter_sample_depthwise_cuda.cpp
filter_sample_depthwise_cuda.h
filter_sample_depthwise_cuda_kernel.cu
nd_linear_sample_cuda.cpp
nd_linear_sample_cuda.h
nd_linear_sample_cuda_kernel.cu
functions
filter_sample_depthwise.py
__init__.py
nd_linear_sample.py
__init__.py
modules
filter_sample_depthwise.py
__init__.py
setup.py
setup.py檔案內容如下:
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
setup(
name='filter_sample_depthwise',
ext_modules=[
CUDAExtension(
'filter_sample_depthwise_cuda',
[
'csrc/filter_sample_depthwise_cuda.cpp',
'csrc/filter_sample_depthwise_cuda_kernel.cu',
]
),
],
cmdclass={'build_ext': BuildExtension}
)
setup(
name="nd_linear_sample",
ext_modules=[
CUDAExtension(
"nd_linear_sample_cuda",
[
"csrc/nd_linear_sample_cuda.cpp",
"csrc/nd_linear_sample_cuda_kernel.cu",
],
)
],
cmdclass={"build_ext": BuildExtension},
)
這個專案包含了cpp-extension的代碼,因此采用了setuptools需要生成py檔案。
采用pip install -e .安裝時,產生如下錯誤:
Obtaining file:///home/xxx/Downloads/deformable_kernels/deformable_kernels/ops/deform_kernel
ERROR: More than one .egg-info directory found in /tmp/pip-pip-egg-info-pta6z__q
將兩個setup()分開后進行安裝,當前檔案夾下產生了兩個.so檔案,而不是.py檔案。
請問有大神知道如何處理這種情況嗎?
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/234434.html
標籤:人工智能技術
上一篇:關于語意分割資料集構造:
下一篇:渦街流量計使用中不可忽視的問題
