Media-Smart / vedadet

A single stage object detection toolbox based on PyTorch
Apache License 2.0
498 stars 128 forks source link

ImportError: cannot import name 'deform_conv_ext' #8

Closed gmt710 closed 3 years ago

gmt710 commented 3 years ago

Greatly thank for your sharing. when I run the command:

tools/dist_trainval.sh configs/trainval/tinaface/tinaface.py "0,1,2,3"

I met this problem:

ImportError: cannot import name 'deform_conv_ext'

Maybe this cause by dcn, Would you mind giving some suggestions for me? Thx.

hxcai commented 3 years ago

@gmt710 Have you installed vedadet as following? pip install -r requirements/build.txt pip install -v -e .

gmt710 commented 3 years ago

Yeah, I'll try again.

gmt710 commented 3 years ago

Can I use torch==1.1.0 ? Because my cuda version is 9.0.

hxcai commented 3 years ago

@gmt710 we recommend using torch==1.6.0 or higher.

gmt710 commented 3 years ago

@hxcai ,thanks for your reply.My enviroment ,cuda9.2 torch1.6.0 test good. I have another problem about how to prepare widerface datasets for train and test ? Refers the code comments and the bugs, I prepare widerface data but test and train are not working properly. image

Kerr46 commented 3 years ago

Thank you for your sharing. But I have this issue,too. I don't know how to figure it out.

ImportError: cannot import name 'deform_conv_ext'

I have try this : pip install -r requirements/build.txt pip install -v -e .

But I've got :

Using pip 20.2.4 from /home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip (python 3.7) Non-user install because site-packages writeable Created temporary directory: /tmp/pip-ephem-wheel-cache-l6jhmr6r Created temporary directory: /tmp/pip-req-tracker-mxmsm8pp Initialized build tracking at /tmp/pip-req-tracker-mxmsm8pp Created build tracker: /tmp/pip-req-tracker-mxmsm8pp Entered build tracker: /tmp/pip-req-tracker-mxmsm8pp Created temporary directory: /tmp/pip-install-yi04rbse Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///home/cv/PycharmProjects/vedadet Added file:///home/cv/PycharmProjects/vedadet to build tracker '/tmp/pip-req-tracker-mxmsm8pp' Running setup.py (path:/home/cv/PycharmProjects/vedadet/setup.py) egg_info for package from file:///home/cv/PycharmProjects/vedadet Created temporary directory: /tmp/pip-pip-egg-info-63ncdptk Running command python setup.py egg_info /home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at /opt/conda/conda-bld/pytorch_1603729138878/work/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0 Traceback (most recent call last): File "", line 1, in File "/home/cv/PycharmProjects/vedadet/setup.py", line 146, in 'src/cuda/nms_cuda.cpp', 'src/cuda/nms_kernel.cu' File "/home/cv/PycharmProjects/vedadet/setup.py", line 33, in make_cuda_ext raise EnvironmentError('CUDA is required to compile vedadet') OSError: CUDA is required to compile vedadet No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda' Compiling nms_ext without CUDA ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Exception information: Traceback (most recent call last): File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 228, in _main status = self.run(options, args) File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper return func(self, options, args) File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 324, in run reqs, check_supported_wheels=not options.target_dir File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve discovered_reqs.extend(self._resolve_one(requirement_set, req)) File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 326, in _get_abstract_dist_for return self.preparer.prepare_editable_requirement(req) File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 526, in prepare_editable_requirement req, self.req_tracker, self.finder, self.build_isolation, File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 91, in _get_prepared_distribution abstract_dist.prepare_distribution_metadata(finder, build_isolation) File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/distributions/sdist.py", line 40, in prepare_distribution_metadata self.req.prepare_metadata() File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 555, in prepare_metadata self.metadata_directory = self._generate_metadata() File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 535, in _generate_metadata details=self.name or "from {}".format(self.link) File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 73, in generate_metadata command_desc='python setup.py egg_info', File "/home/cv/anaconda3/envs/tinaface/lib/python3.7/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess raise InstallationError(exc_msg) pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Removed file:///home/cv/PycharmProjects/vedadet from build tracker '/tmp/pip-req-tracker-mxmsm8pp' Removed build tracker: '/tmp/pip-req-tracker-mxmsm8pp'

hxcai commented 3 years ago

@gmt710 please see this for data preparing.

hxcai commented 3 years ago

@Kerr46 It seems that your environment has no cuda?

gmt710 commented 3 years ago

@hxcai , Greatly Thanks. I'll try.

gmt710 commented 3 years ago

@hxcai ,I follow this ,also met same problem. Maybe parse xml do not work.

mike112223 commented 3 years ago

@gmt710 please check in #11

gmt710 commented 3 years ago

@mike112223 ,Thanks. I'll try.

gmt710 commented 3 years ago

I took some notes for reference. Anyone needed can click this.(more informations)

my enviroment:

ubuntu16.04
python3.6
cuda9.2
pytorch 1.6.0 

Now the reference include preparing enviroment, datasets and testing on widerface val datasets. If I have time, I will update it.

hxcai commented 3 years ago

@gmt710 Great, thanks for sharing!

gmt710 commented 3 years ago

Thanks. The result is same with your paper. I test no TTA(the result is good): image

gmt710 commented 3 years ago

If I want to use cuda9.0, Do you have any suggestions for me to modify dcn? I've tried the version of dcn from mmdetection several times but fail .

hxcai commented 3 years ago

@gmt710 You can try to use dcn in old version mmdetection that supports cuda9.0. But we don't recommend to do that.

gmt710 commented 3 years ago

@hxcai , Is this mainly because there is a corresponding relationship between torch and CUDA versions?

hxcai commented 3 years ago

@gmt710 specified torch and dcn implementation is related to specified cuda version.

yehudit22 commented 8 months ago

I am still facing the same problem after doing all of what was suggested above, can anyone help?