KeyError: 'colors'

This category is for question related to accounts on https://app.roboflow.com/

Please share the following so we may better assist you:

  1. Project type: Object detection
  2. Windows-10
  3. When I ran the file in the terminal, this error showed up.

(openvino_env) C:\Users\risha\depthai-main>python3 depthai-python/Ball_Tracker-1/Oak.py
Traceback (most recent call last):
File “C:\Users\risha\depthai-main\depthai-python\Ball_Tracker-1\Oak.py”, line 9, in
rf = RoboflowOak(model=“ball_tracker”, confidence=0.05, overlap=0.5,
File “C:\Users\risha\depthai-main\openvino_env\lib\site-packages\roboflowoak_init_.py”, line 31, in init
self.cache_path = self.find_weights()
File “C:\Users\risha\depthai-main\openvino_env\lib\site-packages\roboflowoak_init_.py”, line 59, in find_weights
return download_blob(self.project, self.version, self.api_key, self.dev)
File “C:\Users\risha\depthai-main\openvino_env\lib\site-packages\roboflowoak\api.py”, line 22, in download_blob
model_objects[‘colors’] = api_data[‘oak’][‘colors’]
KeyError: ‘colors’

Any help?

I’m running into the same problem on my raspberry pi, by any chance did you find a solution?

@Aidan_Montag @Rishabh_verma did you two use Modify Classes on the generated versions these models are being deployed from?

I’m having a similar error (below) and I did use the “Modify Classes” feature on my DeerWatch dataset. Is there a step I can take to modify the code and make this work?

Traceback (most recent call last):
File “Roboflow_deployModelOnOakD.py”, line 8, in
rf = RoboflowOak(model=“DeerWatch”, confidence=0.05,
File “C:\Users\zacra\Documents\Autonomous_Driving\OAK_depthAI\depthai-main\myOAKvenv\lib\site-packages\roboflowoak_init_.py”, line 31, in init
self.cache_path = self.find_weights()
File “C:\Users\zacra\Documents\Autonomous_Driving\OAK_depthAI\depthai-main\myOAKvenv\lib\site-packages\roboflowoak_init_.py”, line 59, in find_weights
return download_blob(self.project, self.version, self.api_key, self.dev)
File “C:\Users\zacra\Documents\Autonomous_Driving\OAK_depthAI\depthai-main\myOAKvenv\lib\site-packages\roboflowoak\api.py”, line 21, in download_blob
model_objects[‘class_names’] = api_data[‘oak’][‘classes’]
KeyError: ‘oak’

I had the same error. It turns out the “model” parameter in the RoboflowOak function is wrong.

Click on these three dots on your model page and you should see “Copy Project Id”. Click on it and paste it into the “model” parameter.

Hopefully this helps!