Open caishanli opened 3 years ago
{
ncnn::destroy_gpu_instance();
}
void detect()
{
ncnn::Net yolov4;
yolov4.opt.use_vulkan_compute = true;
yolov4.load_param("yolov4-tiny-opt.param");
yolov4.load_model("yolov4-tiny-opt.bin");
return;
}
main:
detect();
clearvk();
void detect2()
{
ncnn::Net *yolov4=new ncnn::Net;
yolov4->opt.use_vulkan_compute = true;
yolov4->load_param("yolov4-tiny-opt.param");
yolov4->load_model("yolov4-tiny-opt.bin");
delete yolov4;
ncnn::destroy_gpu_instance();
return;
}
main:
detect2();
ncnn -- > dll
{ ncnn::destroy_gpu_instance(); } void detect() { ncnn::Net yolov4; yolov4.opt.use_vulkan_compute = true; yolov4.load_param("yolov4-tiny-opt.param"); yolov4.load_model("yolov4-tiny-opt.bin"); return; } main: detect(); clearvk();
void detect2() { ncnn::Net *yolov4=new ncnn::Net; yolov4->opt.use_vulkan_compute = true; yolov4->load_param("yolov4-tiny-opt.param"); yolov4->load_model("yolov4-tiny-opt.bin"); delete yolov4; ncnn::destroy_gpu_instance(); return; } main: detect2();
ncnn -- > dll
Great work! But when binding ncnn to python extension, up says that delete net manually in python is very ugly...
yolov4.clear();
ncnn::destroy_gpu_instance();
在vs2017下运行,看到gpu信息后关闭cmd窗口,仍然会在vkDestroyDevice(d->device, 0); 崩。
build ncnn with vulkan, and use it in a shared library(tested on windows now), will crash at exit. code is here, yolov4 param is here code tree: ----shared library --------yolov4_vk.h
--------yolov4_vk.cpp
----main --------main.cpp
----CMakeLists.txt
crash screen shot: