天天看點

yolo v3 fatal : Memory allocation failure

torch版的 yolov3報錯:

fatal   : Memory allocation failure

parser.add_argument('--n_cpu', type=int, default=8, help='number of cpu threads to use during batch generation')      
dataloader = DataLoader(ImageFolder('data/samples', img_size=opt.img_size),
                        batch_size=opt.batch_size, shuffle=False, num_workers=opt.n_cpu)      

原因:n_cpu太多,記憶體不夠了

解決方法:

把n_cpu調低就好了

繼續閱讀