• Community
  • about Deploy A Custom Model to the Luxonis OAK - A Quickstart Guide.

Deploy A Custom Model to the Luxonis OAK - A Quickstart Guide
Doing the following

Roboflow-YOLOv3-tiny-Darknet-to-OAK (Jan2020 Darknet).ipynb
(Infer Custom Objects with Saved YOLOv4 Weights)

I got the following error.
Please teach me how to solve it.

	AttributeError: 'NoneType' object has no attribute 'shape'


#/test has images that we can test our detector on
test_images = [f for f in os.listdir('test') if f.endswith('.jpg')]
import random
img_path = "test/" + random.choice(test_images);

#test out our detector!
!./darknet detect cfg/custom-yolov3-tiny-detector.cfg backup/custom-yolov3-tiny-detector_best.weights {img_path} -dont-show
imShow('predictions.jpg')



 CUDA-version: 11010 (11020), cuDNN: 7.6.5, GPU count: 1  
 OpenCV version: 3.2.0
 0 : compute_capability = 370, cudnn_half = 0, GPU: Tesla K80 
net.optimized_memory = 0 
mini_batch = 1, batch = 4, time_steps = 1, train = 0 
   layer   filters  size/strd(dil)      input                output
   0 Create CUDA-stream - 0 
 Create cudnn-handle 0 
conv     16       3 x 3/ 1    416 x 416 x   3 ->  416 x 416 x  16 0.150 BF
   1 max                2x 2/ 2    416 x 416 x  16 ->  208 x 208 x  16 0.003 BF
   2 conv     32       3 x 3/ 1    208 x 208 x  16 ->  208 x 208 x  32 0.399 BF
   3 max                2x 2/ 2    208 x 208 x  32 ->  104 x 104 x  32 0.001 BF
   4 conv     64       3 x 3/ 1    104 x 104 x  32 ->  104 x 104 x  64 0.399 BF
   5 max                2x 2/ 2    104 x 104 x  64 ->   52 x  52 x  64 0.001 BF
   6 conv    128       3 x 3/ 1     52 x  52 x  64 ->   52 x  52 x 128 0.399 BF
   7 max                2x 2/ 2     52 x  52 x 128 ->   26 x  26 x 128 0.000 BF
   8 conv    256       3 x 3/ 1     26 x  26 x 128 ->   26 x  26 x 256 0.399 BF
   9 max                2x 2/ 2     26 x  26 x 256 ->   13 x  13 x 256 0.000 BF
  10 conv    512       3 x 3/ 1     13 x  13 x 256 ->   13 x  13 x 512 0.399 BF
  11 max                2x 2/ 1     13 x  13 x 512 ->   13 x  13 x 512 0.000 BF
  12 conv   1024       3 x 3/ 1     13 x  13 x 512 ->   13 x  13 x1024 1.595 BF
  13 conv    256       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x 256 0.089 BF
  14 conv    512       3 x 3/ 1     13 x  13 x 256 ->   13 x  13 x 512 0.399 BF
  15 conv     21       1 x 1/ 1     13 x  13 x 512 ->   13 x  13 x  21 0.004 BF
  16 yolo
[yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00
  17 route  13 		                           ->   13 x  13 x 256 
  18 conv    128       1 x 1/ 1     13 x  13 x 256 ->   13 x  13 x 128 0.011 BF
  19 upsample                 2x    13 x  13 x 128 ->   26 x  26 x 128
  20 route  19 8 	                           ->   26 x  26 x 384 
  21 conv    256       3 x 3/ 1     26 x  26 x 384 ->   26 x  26 x 256 1.196 BF
  22 conv     21       1 x 1/ 1     26 x  26 x 256 ->   26 x  26 x  21 0.007 BF
  23 yolo
[yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00
Total BFLOPS 5.449 
avg_outputs = 325057 
 Allocate additional workspace_size = 12.46 MB 
Loading weights from backup/custom-yolov3-tiny-detector_best.weights...Couldn't open file: backup/custom-yolov3-tiny-detector_best.weights
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-20-aa5194b51f2a> in <module>()
      7 #test out our detector!
      8 get_ipython().system('./darknet detect cfg/custom-yolov3-tiny-detector.cfg backup/custom-yolov3-tiny-detector_best.weights {img_path} -dont-show')
----> 9 imShow('predictions.jpg')

<ipython-input-15-503261adaacf> in imShow(path)
      6 
      7   image = cv2.imread(path)
----> 8   height, width = image.shape[:2]
      9   resized_image = cv2.resize(image,(3*width, 3*height), interpolation = cv2.INTER_CUBIC)
     10 

AttributeError: 'NoneType' object has no attribute 'shape'
a year later

Hi sarrajouini ,
I would suggest using yolov5 notebook on our depthai-ml-training repository, as it's the most up-to-date.
Thanks, Erik