为什么训练这么慢?

时间:2019-08-19 14:41:25

标签: python tensorflow machine-learning neural-network

我开始使用具有16 GB RAM的GeForce RTX 2070训练模型,但是即使是一个时期也要花费很多时间。例如,一个纪元要花10个多小时。因为要获得良好的效果,需要将近100个纪元。因此,我在培训过程中遇到了问题,因为我没有时间等待一个月才能完成培训。

数据集近500,000张图像,总大小为200 GB。

我正在使用重量为tiny-yolov2的YOLO(在暗网中)。我的tensorflow版本是1.12.0。重量和配置文件是从官方网站下载的。选项中的GPU使用率设置为0.8。

在开始训练之前,我的GPU使用率是:

enter image description here

开始训练后:

enter image description here

代码:

import matplotlib.pyplot as plt
import numpy as np

from darkflow_master2.darkflow.net.build import TFNet
import cv2
import os
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'

options = {"model": "cfg/yolov2-3c.cfg",
           "load": "bin/yolov2.weights",
           "batch": 64,
           "epoch": 2,
           "gpu": 0.8,
           "train": True,
           "savepb": True,
           "save": 1000,
           "annotation": "./annotations/",
           "dataset": "./images/",
           "lr  ": 1e-3}

tfnet = TFNet(options)

0 个答案:

没有答案