I'm getting an attribute error using tensorflow

selenanur selenanur097 at gmail.com
Sat Sep 19 06:10:47 UTC 2020


I'm pretty new to python and this code is for object detection, 
it works fine on my webcam but has an error when using an 
external camera This is what I have:

for classId, confidence,box in 
zip(classIds.flatten(),confs.flatten(),bbox):
         cv2.rectangle(img,box,color=(0,255,0),thickness=2)
         
cv2.putText(img,classNames[classId-1].upper(),(box[0]+10,box[1]+30),
                     cv2.FONT_HERSHEY_COMPLEX,1,(0,255,0),2)
Here's the message I got:

Traceback (most recent call last):
   File "C:/Users/byeo9/PycharmProjects/FYP-ENV/Testing 2.py", 
line 31, in <module>
     for classId, confidence,box in 
zip(classIds.flatten(),confs.flatten(),bbox):
AttributeError: 'tuple' object has no attribute 'flatten'


More information about the Digitalmars-d mailing list