This commit is contained in:
Glenn Jocher 2019-11-20 13:40:24 -08:00
parent bb209111c4
commit 3a4ed8b3ab
2 changed files with 2 additions and 2 deletions

View File

@ -412,7 +412,7 @@ if __name__ == '__main__':
parser.add_argument('--bucket', type=str, default='', help='gsutil bucket')
parser.add_argument('--img-weights', action='store_true', help='select training images by weight')
parser.add_argument('--cache-images', action='store_true', help='cache images for faster training')
parser.add_argument('--weights', type=str, default='', help='initial weights')
parser.add_argument('--weights', type=str, default='weights/ultralytics49.pt', help='initial weights')
parser.add_argument('--arc', type=str, default='default', help='yolo architecture') # defaultpw, uCE, uBCE
parser.add_argument('--prebias', action='store_true', help='transfer-learn yolo biases prior to training')
parser.add_argument('--name', default='', help='renames results.txt to results_name.txt if supplied')

View File

@ -44,7 +44,7 @@ def load_classes(path):
def labels_to_class_weights(labels, nc=80):
# Get class weights (inverse frequency) from training labels
if labels[0] is None: # no labels loaded
return None
return torch.Tensor()
labels = np.concatenate(labels, 0) # labels.shape = (866643, 5) for COCO
classes = labels[:, 0].astype(np.int) # labels = [class xywh]