Hanqer / deep-hough-transform

Jittor and Pytorch code for paper "Deep Hough Transform for Semantic Line Detection" (ECCV 2020, PAMI 2021)
339 stars 71 forks source link

ImportError: No module named 'cd #22

Closed xuyichengyy closed 2 years ago

xuyichengyy commented 3 years ago

This error occurs when I execute train.py Because I can't install tensorboardX. So i removed the code in train.py that used tensorboardX. But I don't think this operation has anything to do with this error. the error is below Traceback (most recent call last): File "train.py", line 24, in <module> from hungarian_matching import caculate_tp_fp_fn File "/home/cver0/cxy/deep-hough-transform-master/hungarian_matching.py", line 4, in <module> from metric import EA_metric, Chamfer_metric, Emd_metric File "/home/cver0/cxy/deep-hough-transform-master/metric.py", line 6, in <module> from chamfer_distance import ChamferDistance File "/home/cver0/cxy/deep-hough-transform-master/chamfer_distance/__init__.py", line 1, in <module> from .chamfer_distance import ChamferDistance File "/home/cver0/cxy/deep-hough-transform-master/chamfer_distance/chamfer_distance.py", line 7, in <module> "chamfer_distance/chamfer_distance.cu"]) File "/home/cver0/anaconda3/envs/volo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1091, in load keep_intermediates=keep_intermediates) File "/home/cver0/anaconda3/envs/volo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1317, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "/home/cver0/anaconda3/envs/volo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1699, in _import_module_from_library file, path, description = imp.find_module(module_name, [path]) File "/home/cver0/anaconda3/envs/volo/lib/python3.6/imp.py", line 297, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named 'cd'

Hanqer commented 3 years ago

CD is the chamfer distance metric as described in the paper. But it is not used by default. Currently, I don't know why you can't import cd as a module from sources. Maybe the reason is the version of PyTorch is not compatible, and I can't reproduce this error. You can easily remove the use of chamfer distance which is not used by default. In this way, you can remove the Chamfer_metric in line 4 in hungarian_matching.py, and lines 6, 8, 28-44 in metric.py.