乱红飞 2018-01-30 07:17 采纳率: 40%
浏览 2087
已结题

【cudaFree() failed. Reason: driver shutting down 】

问题说明:
定义检测网络时,定义为全局变量会引发问题,但是定义为局部变量就没有这个问题。哪位大神遇到过类似情况,请求指教。。

//net_type detect_net;
//anet_type feature_net;

//示例代码:
#include
#include
#include
#include
//#include

#include

using namespace std;
using namespace dlib;

// ----------------------------------------------------------------------------------------
//hog face detecting

template class,int,typename> class block, int N, templateclass BN, typename SUBNET>
using residual = add_prev1>>;

template class,int,typename> class block, int N, templateclass BN, typename SUBNET>
using residual_down = add_prev2>>>>>;

template class BN, int stride, typename SUBNET>
using block = BN>>>>;

template using ares = relu>;
template using ares_down = relu>;

template using alevel0 = ares_down;
template using alevel1 = ares>>;
template using alevel2 = ares>>;
template using alevel3 = ares>>>;
template using alevel4 = ares>>;

using anet_type = loss_metric alevel0 alevel1 alevel2 alevel3 alevel4 max_pool input_rgb_image_sized
>>>>>>>>>>>>;

// ------------------------------------------------------------------------------------------------------------
// dnn face detecting

template using con5d = con;
template using con5 = con;

template using downsampler = relu>>>>>>>>;
template using rcon5 = relu>>;

using net_type = loss_mmod>>>>>>>;

// ------------------------------------------------------------------------------------------------------------
// define the global variable

//shape_predictor sp;
//net_type detect_net;
//anet_type feature_net;

void sc_face_recog_init();
void sc_face_recog_init()
{
/*
shape_predictor sp;
net_type detect_net;
anet_type feature_net;

*/

deserialize("mmod_human_face_detector.dat") >> detect_net;
deserialize("shape_predictor_5_face_landmarks.dat") >> sp;
deserialize("dlib_face_recognition_resnet_model_v1.dat") >> feature_net;

}

int main(int argc, char *argv[])
{
printf("hello\n\n\n\n");
//运行是出现错误 cudaFree() failed. Reason: driver shutting down
// cudaFreeHost() failed. Reason: driver shutting down
sc_face_recog_init();
detect_net.clean();

return 0;

}


  • 写回答

3条回答 默认 最新

  • KMCDTC 2018-01-30 08:57
    关注

    驱动缺少,不可以把他重复使用

    评论

报告相同问题?

悬赏问题

  • ¥50 comsol稳态求解器 找不到解,奇异矩阵有1个空方程返回的解不收敛。没有返回所有参数步长;pid控制
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功