'depthai.DeviceInfo' object has no attribute 'name'
I would be curious to know how this got resolved.
I use depth Version: 2.22.0.0, but I get the following error:
Connected cameras: [{socket: CAM_A, sensorName: IMX214, width: 4208, height: 3120, orientation: AUTO, supportedTypes: [COLOR], hasAutofocus: 1, name: color}, {socket: CAM_B, sensorName: OV7251, width: 640, height: 480, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, name: left}, {socket: CAM_C, sensorName: OV7251, width: 640, height: 480, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, name: right}]
Usb speed: HIGH
Traceback (most recent call last):
File "ColorCamera/rgb_preview.py", line 33, in <module>
print('Device name:', device.getDeviceName(), ' Product name:', device.getProductName())
AttributeError: 'depthai.Device' object has no attribute 'getProductName'
I tried running python3 -mpip install depthai -U
but the terminal eventually stops with the following error: ERROR: Failed building wheel for depthai
I am running out of ideas
Hi srecouvreur
It's not a depthai issue, but EEPROM one. The device has been flashed some time ago and doesn't have the product
field (you can check that with Eeprom reader script).
Just remove the getProductName()
call from inside the script and it should work.
Thanks,
Jaka
Okay, interestingly the code I was using from the Github repo (below) doesn't have that getProductName() call, despite showing as an error in the log
#!/usr/bin/env python3
import cv2import depthai as dai
# Create pipelinepipeline = dai.Pipeline()
# Define source and outputcamRgb = pipeline.create(dai.node.ColorCamera)xoutVideo = pipeline.create(dai.node.XLinkOut)
xoutVideo.setStreamName("video")
# PropertiescamRgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)camRgb.setVideoSize(1920, 1080)
xoutVideo.input.setBlocking(False)xoutVideo.input.setQueueSize(1)
# LinkingcamRgb.video.link(xoutVideo.input)
# Connect to device and start pipelinewith dai.Device(pipeline) as device:
video = device.getOutputQueue(name="video", maxSize=1, blocking=False)
while True: videoIn = video.get()
# Get BGR frame from NV12 encoded video frame to show with opencv # Visualizing the frame on slower hosts might have overhead cv2.imshow("video", videoIn.getCvFrame())
if cv2.waitKey(1) == ord('q'): break
But implementing the older documentation code instead and commenting out line 33 (with that specific call)… it works!
Is it possible that the current (new) code in the repository is erroneous?
srecouvreur
That's not even the same example
Ah sorry I got mixed up between the different examples I was trying to run - all good