上下文:我正在使用由数据科学家制作的自定义CoreML模型。该模型是使用Apple SoundAnalysisPreprocessing
模型作为第一个模型的管道。 SoundAnalysisPreprocessing
模型后面是包含不同卷积层和softmax的自定义模型。
问题:启动预测时,有时会得到Unexpected error processing model
。使用完全相同的输入,有时会得到正确的结果,有时会出现此错误。
问题:我不知道如何处理此错误。输入分配错误是内存问题吗?模型本身有问题吗?您知道我能做什么来了解正在发生的事情吗?
完整的错误日志:
[DSPGraph] throwing DSPGraph::Exception with backtrace:
0 0x7fff2bcf5df9 DSPGraph::Graph::processMultiple(DSPGraph::GraphIOData*, DSPGraph::GraphIOData*) + 249
1 0x7fff2bc3b570 processThroughGraph(id<MLFeatureProvider>, MLMultiArrayConstraint*, MLMultiArray*, NSString*, DSPGraph::Graph&, std::__1::vector<float, DSPGraph::Graph&::allocator<float> >&, void (DSPGraph::Graph, NSString*::GraphIOData&) block_pointer, NSError* __autoreleasing*) + 979
2 0x7fff2bc3c573 -[SNDSPGraphCustomModel predictionFromFeatures:options:error:] + 195
3 0x7fff2bc3ca49 -[_SNVGGishFrontEndProcessingCustomModel predictionFromFeatures:options:error:] + 98
4 0x7fff2496ac30 -[MLAppleSoundAnalysisPreprocessing predictionFromFeatures:options:error:] + 132
5 0x7fff248d345c -[MLPipeline predictionFromFeatures:options:error:] + 178
6 0x7fff24923f76 -[MLModel predictionFromFeatures:error:] + 92
7 0x104b89a68 $s10TestCoreML17AudioFileAnalyzerC019previsionWithManualD3Cut33_1966162A0510E69792A8D979B37CC177LL3for10completiony10Foundation3URLV_ySo12MLMultiArrayCSgXEtF + 5992
8 0x104b87850 $s10TestCoreML17AudioFileAnalyzerC05startF03for10completiony10Foundation3URLV_yyXEtF + 80
9 0x104bb360c $s10TestCoreML23ClassificationViewModelC14startRecognize4word8mockData11resultBlock06finishM0ySS_SbySb_SaySo16SNClassificationCGSgtcSgyyctF + 3436
10 0x104bad21c $s10TestCoreML18ReadViewControllerC010collectionE0_15didSelectItemAtySo012UICollectionE0C_10Foundation9IndexPathVtFyycfU_ + 220
11 0x104b923fd $sIeg_IeyB_TR + 45
12 0x104f79d64 _dispatch_client_callout + 8
13 0x104f7c6d6 _dispatch_continuation_pop + 552
14 0x104f8fa8f _dispatch_source_invoke + 2205
15 0x104f87c53 _dispatch_main_queue_callback_4CF + 1043
[truncated?]
2019-10-30 20:33:04.209693+0100 TestCoreML[5024:191792] [] Caught graph exception 1718775073 !mrf fromBytePos (0) + numBytesToCopy (61440) > mABL->mBuffers[0].mDataByteSize (2112) in /BuildRoot/Library/Caches/com.apple.xbs/Sources/Listen_Sim/Listen-35/CoreAudioUtility/Source/CADSP/DSPGraph/DSPGraph_Utils.cpp:742
我相信您需要更新代码中的某些库。基于与您的错误有关的GitHub。
图形异常1718775073是关键。
在论坛上,他们说这是解决办法,因为传入呼叫变量与传出呼叫变量之间存在怪异的区别。
if (-0.01f <= hw_srate || hw_srate >= 0.1.f)
{
fmt.mSampleRate = prm->state;
fat->sample_rate = 1.0f;
}