乱红飞 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
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面