Open fengshikun opened 7 years ago
I construct a new classification forward instance in main thread like this:
// construct a new forward class Caffe::set_mode(Caffe::GPU); net_.reset(new Net(model_file, TEST)); net_->CopyTrainedLayersFrom(trained_file);
and pass this instance to a new thread to do forward. but this new thread failed to use GPU.
from https://github.com/BVLC/caffe/issues/4178, I add Caffe::set_mode(Caffe::GPU); before each forward operation, but it will complains:
Caffe::set_mode(Caffe::GPU);
gpu_memory.hpp:90 Check failed: 'prt_' Must be non NULL.
How to reset the GPU configuration to make it normal, thanks!
Operating system: Ubuntu16.06 with CUDA8.0
have you tried constructing the net in the thread instead of passing it?
Issue summary
I construct a new classification forward instance in main thread like this:
and pass this instance to a new thread to do forward. but this new thread failed to use GPU.
from https://github.com/BVLC/caffe/issues/4178, I add
Caffe::set_mode(Caffe::GPU);
before each forward operation, but it will complains:How to reset the GPU configuration to make it normal, thanks!
Your system configuration
Operating system: Ubuntu16.06 with CUDA8.0