question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to import pydarknet

See original GitHub issue

Hi I am getting following error

`>>> import pydarknet Traceback (most recent call last): File “<stdin>”, line 1, in <module> ImportError: /home/ntweat/Desktop/yolo/PyYOLOV3/pydarknet.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZN2cv8fastFreeEPv

`

Thanks for the wrapper

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
madhawavcommented, Apr 12, 2018

@justinas-kazanavicius

  • Can I know the version of Fedora you use?
  • Also, have you made any progress following what @abossenbroek said.

Thanks

1reaction
madhawavcommented, Apr 12, 2018

@justinas-kazanavicius Time readings taken on webcam_test.py. (Time readings are taken in milliseconds)

Master Branch

('Internal Time:', 0.08028554916381836, ':', 0.06916772574186325)
Total Time: 0.08295273780822754 : 0.07138648479168823
Efficiency: 0.9689190600111561
('Internal Time:', 0.06472063064575195, ':', 0.06827830523252487)
Total Time: 0.06650710105895996 : 0.07041060804514258
Efficiency: 0.9697161710171481
('Internal Time:', 0.06425833702087402, ':', 0.06747431308031082)
Total Time: 0.06623339653015137 : 0.06957516574214434
Efficiency: 0.969804561161671

direct-numpy-to-darknet-image-conversion Branch

('Internal Time:', 0.06983137130737305, ':', 0.06395943462848663)
Total Time: 0.07549619674682617 : 0.0697771673644012
Efficiency: 0.9166241199570011
('Internal Time:', 0.062108755111694336, ':', 0.06358929723501205)
Total Time: 0.06771492958068848 : 0.06936471980765867
Efficiency: 0.9167383276590567
('Internal Time:', 0.06394815444946289, ':', 0.06366106867790222)
Total Time: 0.07091593742370605 : 0.06967496333086814
Efficiency: 0.9136864324648796
  • Internal Time: Time taken by native YOLO3 call internally.
  • Total Time: internal time + additional cost of wrapper
  • Efficiency: Average Internal Time / Average Total Time

Internal time measurement at pydarknet.pyx

        internal_start = time.time()
        network_predict_image(self.net, image.img)
        dets = get_network_boxes(self.net, image.img.w, image.img.h, thresh, hier_thresh, <int*>0, 0, pnum)

        num = pnum[0]
        if (nms > 0):
            do_nms_obj(dets, num, self.meta.classes, nms)

        internal_end = time.time()
        self.average_internal_time = self.average_internal_time * 0.8 + (internal_end-internal_start) * 0.2
        print("Internal Time:",internal_end-internal_start, ":", self.average_internal_time)

Total time measurement at webcam_test.py

            start_time = time.time()

            # Only measure the time taken by YOLO and API Call overhead

            dark_frame = Image(frame)
            results = net.detect(dark_frame)
            del dark_frame

            end_time = time.time()
            average_time = average_time * 0.8 + (end_time-start_time) * 0.2

            print("Total Time:", end_time-start_time, ":", average_time)
            print("Efficiency:", net._get_average_time()/average_time)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Import darknet FileNotFoundError: Could not find module
It throws an error when the yolo_cpp_dll.dll file is imported. Here's how to fix it: Install Python 3.7 or lower (3.6 worked for...
Read more >
ImportError: No module named pydarknet · Issue #132
I'm trying to run YOLO-3-4-Py on Ubuntu 18.04. I put a test image named img1.png in ~/YOLO-3-4-Py/demo/, but after I got in YOLO-3-4-Py...
Read more >
yolo34py
Download and execute this script to download model files. Create sampleApp.py with following code. Specify SAMPLE_INPUT_IMAGE. from pydarknet import Detector, ...
Read more >
Object Detection with Yolo Python and OpenCV- Yolo 2
In this blog, we will see how to setup object detection with Yolo and Python on images and video. We will also use...
Read more >
Python Cython.Distutils.build_ext.run() Examples
def run(self): # Import numpy here, only when headers are needed import numpy ... '--dirty']).decode('ascii').strip() except: print('Unable to run Git, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found