简体   繁体   English

从VGG提取特征

[英]Extracting Features from VGG

I want to extract features from images in MS COCO dataset using a fine-tuned VGG-19 network. 我想使用微调的VGG-19网络从MS COCO数据集中的图像中提取特征。

However, it takes about 6~7 seconds per image, roughly 2 hours per 1k images. 但是,每张图像大约需要6到7秒,每1k图像大约需要2个小时。 (even longer for other fine-tuned models) (对于其他经过微调的型号,甚至更长)

There are 120k images in MS COCO dataset, so it'll take at least 10 days. MS COCO数据集中有12万张图片,因此至少需要10天。

Is there any way that I can speed up the feature extraction process? 有什么方法可以加快特征提取过程?

Well, this is not just a command. 好吧,这不仅仅是命令。 First you must check whether your GPU is powerful enough to wrestle with deep CNNs. 首先,您必须检查您的GPU是否足够强大以与深层的CNN搏斗。 Knowing your GPU model can answer this question. 了解您的GPU模型可以回答这个问题。

Second, you have to compile and build Caffe framework with CUDA and GPU-enabled (CPU_Only disabled) in the Makefile.config (or CMakeLists.txt). 其次,您必须在Makefile.config(或CMakeLists.txt)中使用CUDA和启用GPU(禁用CPU_Only)编译和构建Caffe框架。

Passing all required steps (installing Nvidia Driver, installing CUDA and etc.) you can build caffe for GPU-use. 通过所有必需的步骤(安装Nvidia驱动程序,安装CUDA等),您可以构建caffe以供GPU使用。 Then by passing the GPU_Device_ID in your command-line you can benefit from speed provided by them. 然后,通过在命令行中传递GPU_Device_ID,您可以从它们提供的速度中受益。

Follow this link for building Caffe using GPU. 请点击链接以使用GPU构建Caffe。

Hope it helps 希望能帮助到你

This ipython notebook example explains the steps to extract features out of any caffe model really well: https://github.com/BVLC/caffe/blob/master/examples/00-classification.ipynb 这个ipython笔记本示例很好地解释了从任何caffe模型中提取特征的步骤: https : //github.com/BVLC/caffe/blob/master/examples/00-classification.ipynb

In pycaffe, you can set gpu mode simply by using caffe.set_mode_gpu(). 在pycaffe中,您可以简单地通过使用caffe.set_mode_gpu()来设置GPU模式。

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

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