简体   繁体   English

最近 ImageAI 更新后自定义 Object 检测训练期间几乎没有 GPU 使用

[英]Little to No GPU Usage during Custom Object Detection Training After Recent ImageAI Update

I have trained a custom object detection model using 750 images using ImageAI on Google Colab Pro about a month ago using TensorFlowGPU 1.13 and have roughly 30min/epoch training time.大约一个月前,我使用 TensorFlowGPU 1.13 在 Google Colab Pro 上使用 ImageAI 使用 750 张图像训练了自定义 object 检测 model,并且大约有 30 分钟/epoch 的训练时间。 Now, when I train using the same dataset but with TensorFlowGPU 2.4.3 (ImageAI doesnt support old TF anymore), I am getting very little GPU usage (0.1GB) and 6 hour per epoch training times.现在,当我使用相同的数据集但使用 TensorFlowGPU 2.4.3(ImageAI 不再支持旧的 TF)进行训练时,我得到的 GPU 使用量(0.1GB)和每个 epoch 的训练时间为 6 小时。 I have tried training the same model on my local machine and I am getting very slow training times as well.我曾尝试在本地机器上训练相同的 model,但训练时间也很慢。

I am using the following imports (based on ImageAI documentation):我正在使用以下导入(基于 ImageAI 文档):

.pip install tensorflow-gpu==2.4.0 keras==2.4.3 numpy==1.19.3 pillow==7.0.0 scipy==1.4.1 h5py==2.10.0 matplotlib==3.3.2 opencv-python keras-resnet==0.2.0 !pip install imageai --upgrade .pip install tensorflow-gpu==2.4.0 keras==2.4.3 numpy==1.19.3 pillow==7.0.0 scipy==1.4.1 h5py==2.10.0 matplotlib==3.3.2 opencv-python keras-resnet==0.2.0 !pip install imageai --upgrade

I am pulling my training data from Google Drive.我正在从 Google Drive 中提取我的训练数据。

Is there anything I could be missing that could speed up my object detection training times on either Google Colab or my local machine?有什么我可能会丢失的东西可以加快我在 Google Colab 或我的本地机器上的 object 检测训练时间吗? The slow training times is slowing my research down.缓慢的训练时间正在减慢我的研究速度。

If you want full GPU usage, from my experience, you must revert back to previous versions of ImageAI and it's compatible packages.如果你想要完整的 GPU 使用,根据我的经验,你必须恢复到以前版本的 ImageAI 和它的兼容包。 Here is a list of compatible packages that I have installed that work as of now (January 2021) on my local machine and Google Colab:以下是我已安装的兼容软件包列表,这些软件包截至目前(2021 年 1 月)在我的本地计算机和 Google Colab 上运行:

  • TF-GPU==1.13.1 TF-GPU==1.13.1
  • Keras==2.2.4凯拉斯==2.2.4
  • Imageai==2.1.0 Imageai==2.1.0

This fixed any issue caused by the most recent patch of ImageAI.这修复了由 ImageAI 的最新补丁引起的任何问题。 I now am back to full GPU usage.我现在回到完整的 GPU 使用。 Until the issue is patched, I suggest using the old version.在问题修复之前,我建议使用旧版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM