Can Caffe or Caffe2 be given input data directly from gpu?

后端 未结 2 738
粉色の甜心
粉色の甜心 2021-01-25 01:04

I\'ve read caffe2 tutorials and tried pre-trained models. I knew caffe2 will leverge GPU to run the model/net. But the input data seems always be given from CPU(ie. Host) memory

2条回答
  •  生来不讨喜
    2021-01-25 01:49

    As you've noted, using a Python layer forces data in and out of the GPU, and this can cause a huge hit to performance. This is true not just for Caffe, but for other frameworks too. To elaborate on Shai's answer, you could look at this step-by-step tutorial on adding C++ layers to Caffe. The example given should touch on most issues dealing with layer implementation. Disclosure: I am the author.

提交回复
热议问题