CenterNet icon indicating copy to clipboard operation
CenterNet copied to clipboard

module not found while testing project using CenterNet

Open nnuk opened this issue 6 years ago • 2 comments

Hi @xingyizhou . While trying to test my model using the following code I came across issue like "NameError: name 'CenterNet' is not defined". So, I used Path class to resolve the error. Now I am getting issue like "from detectors.detector_factory import detector_factory ModuleNotFoundError: No module named 'detectors'". I have every file set up in the right directory. And I have also given correct path to the files. Can you please guide me?

`import sys from pathlib import Path CENTERNET_PATH = Path("/path/to/CenterNet/src/lib/") sys.path.insert(0, CENTERNET_PATH)

from detectors.detector_factory import detector_factory from opts import opts

MODEL_PATH = Path("/path/to/model") TASK = 'ctdet' # or 'multi_pose' for human pose estimation opt = opts().init('{} --load_model {}'.format(TASK, MODEL_PATH).split(' ')) detector = detector_factoryopt.task

img = Path("image/or/path/to/your/image/") ret = detector.run(img)['results']`

nnuk avatar Jul 09 '20 21:07 nnuk

@xingyizhou If you or anyone can quickly guide me about it. Thanks.

nnuk avatar Jul 10 '20 12:07 nnuk

Did you resolve this problem? I have it right now. Thankss

angrommon avatar May 06 '21 07:05 angrommon