Я пытаюсь использовать Yolo, обученный с использованием предварительно обученной модели. Это мой код:
#PyTorch Variables for images
im_batches = list(map(prep_image, loaded_ims, [inp_dim for x in range(len(imlist))]))
#List containing dimensions of original images
im_dim_list = [(x.shape[1], x.shape[0]) for x in loaded_ims]
im_dim_list = torch.FloatTensor(im_dim_list).repeat(1,2)
Это ошибка, которую я получаю, может кто-нибудь помочь PLS?
AttributeError Traceback (most recent call last)
<ipython-input-39-b6264ca0b0c5> in <module>()
----> 1 im_batches = list(map(prep_image, loaded_ims, [inp_dim for x in range(len(imlist))]))
2
3 #List containing dimensions of original images
4 im_dim_list = [(x.shape[1], x.shape[0]) for x in loaded_ims]
5 im_dim_list = torch.FloatTensor(im_dim_list).repeat(1,2)
1 frames
<ipython-input-9-482a08216481> in letterbox_image(img, inp_dim)
1 def letterbox_image(img, inp_dim):
2 '''resize image with unchanged aspect ratio using padding'''
----> 3 img_w, img_h = img.shape[1], img.shape[0]
4 w, h = inp_dim
5 new_w = int(img_w * min(w/img_w, h/img_h))
AttributeError: 'NoneType' object has no attribute 'shape'