Darknet: Errors in running darknet.py

Created on 6 Jun 2018  路  7Comments  路  Source: pjreddie/darknet

I intend to python wrapper function darknet.py

python darknet.py
Traceback (most recent call last):
File "darknet.py", line 151, in
net = load_net("cfg/yolov3-tiny.cfg", "yolov3-tiny.weights", 0)
ctypes.ArgumentError: argument 1: : wrong type

It has the those errors. What changes should I make? Thanks.

Most helpful comment

found this, add a b in front of the string may solve the problem
net = load_net(b"cfg/yolov3.cfg", b"yolov3.weights", 0)

All 7 comments

Did you run with python 3?

Yes, I did.$ python --version
Python 3.6.1 :: Anaconda custom (64-bit)

this darknet.py file was written for python 2.
There are some differences between python 2 and python 3, they are print function and string.
(You can search on google).
I have change a bit in darknet.py file to run in python 3.
https://github.com/khanh1412/darknet_python_wrap/

Yes, I realized now and download another version from https://github.com/AlexeyAB/darknet/blob/master/darknet.py. Thanks for your help.

@khanh1412 the page you posed is already 404. would you be so kind to maybe repose somewhere

found this, add a b in front of the string may solve the problem
net = load_net(b"cfg/yolov3.cfg", b"yolov3.weights", 0)

@khanh1412 the page you posed is already 404. would you be so kind to maybe repose somewhere

Sorry, I have deleted that repo already.

Was this page helpful?
0 / 5 - 0 ratings