sergiomsilva / alpr-unconstrained

License Plate Detection and Recognition in Unconstrained Scenarios
Other
1.71k stars 607 forks source link

what is the class tpye error? #30

Open soaka0721 opened 5 years ago

soaka0721 commented 5 years ago

Traceback (most recent call last): File "vehicle-detection.py", line 25, in vehicle_net = dn.load_net(vehicle_netcfg, vehicle_weights, 0) ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type Using TensorFlow backend. 2018-12-06 16:27:07.584695: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA Searching for license plates using WPOD-NET Traceback (most recent call last): File "license-plate-ocr.py", line 23, in ocr_net = dn.load_net(ocr_netcfg, ocr_weights, 0)

linzhi123 commented 5 years ago

Maybe you need to convert it to ascii code.decode('ascii') @soaka0721

soaka0721 commented 5 years ago

Maybe you need to convert it to ascii code.decode('ascii') @soaka0721

thank you for your answer @linzhi123

what is the convert it ascii code means? are you saying when i build darknet? or when i run run.sh file? or weights file? How can I be an ascii code.decode?

linzhi123 commented 5 years ago
ocr_weights = './yolov2-voc_final.weights'.encode('ascii')'
ocr_netcfg  = './yolov2-voc.cfg'.encode('ascii')'
ocr_dataset = './voc.data'.encode('ascii')'

like this

guhur commented 5 years ago

This error disappeared for me when I used Python 2 instead of Python 3

kelvin-jose commented 5 years ago

If you're on Python3 you should be using

vehicle_weights = bytes('data/vehicle-detector/yolo-voc.weights', encoding="utf-8")
vehicle_netcfg  = bytes('data/vehicle-detector/yolo-voc.cfg', encoding="utf-8")
vehicle_dataset = bytes('data/vehicle-detector/voc.data', encoding="utf-8")
azhaoaigaga commented 5 years ago

File "/home/zhaolzlz/Desktop/alpr-unconstrained/darknet/python/darknet.py", line 127, in detect im = load_image(image, 0, 0) ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type Excuse me, why is there a type error here