DefTruth / lite.ai.toolkit

🛠 A lite C++ toolkit of awesome AI models, support ONNXRuntime, MNN, TNN, NCNN and TensorRT.
https://github.com/DefTruth/lite.ai.toolkit
GNU General Public License v3.0
3.62k stars 690 forks source link

MacOS 下开启 Metal 会崩溃 #386

Open xp19870106 opened 1 year ago

xp19870106 commented 1 year ago

在void MNNRobustVideoMatting::initialize_interpreter()中,修改代码,设置Metal,如下 MNN::BackendConfig backend_config; backend_config.precision = MNN::BackendConfig::Precision_High; // default Precision_High schedule_config.backendConfig = &backend_config; schedule_config.type = MNN_FORWARD_METAL; schedule_config.backupType = MNN_FORWARD_METAL;

在执行static void test_mnn()的时候,会崩溃

截屏2023-05-12 15 23 48

请问是否我开在MNN Metal的方式不对

DefTruth commented 1 year ago

暂时没有测试过metal哈

xp19870106 commented 1 year ago

暂时没有测试过metal哈

那如果想要开启GPU加速,在Mac下目前是用什么方案呢?

LiYufengzz commented 1 year ago

mnn调用非cpu后端的时候,需要使用CopyFromHostTensor来进行tensor的拷贝,否则会出现空指针导致crash

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity.