CoreML:“意外错误处理模型".有时会发生错误 [英] CoreML : "Unexpected error processing model" error sometimes occurring
问题描述
上下文:我正在使用由数据科学家制作的自定义CoreML模型.该模型是使用Apple SoundAnalysisPreprocessing
模型作为第一个模型的管道. SoundAnalysisPreprocessing
模型之后是包含不同卷积层和softmax的自定义模型.
Context:
I'm using a custom CoreML model made by a datascientist.
The model is a pipeline that uses Apple SoundAnalysisPreprocessing
model as it's first model. SoundAnalysisPreprocessing
model is followed by a custom model that contains different convolution layers and a softmax.
问题:启动预测时,有时会得到意外错误处理模型
.使用完全相同的输入,有时会得到正确的结果,有时会出现此错误.
Issue:
When launching a prediction, I sometimes get Unexpected error processing model
. With the exact same input, I sometimes get a correct result and sometimes I get this error.
问题:我不知道如何处理此错误.输入分配错误是内存问题吗?模型本身有问题吗?您知道我能做什么来了解正在发生的事情吗?
Question: I have no clue what to do with this error. Is it a memory problem with input being badly allocated ? Is it a problem with the model itself ? Do you have any idea what I could do to understand what is happening ?
完整的错误日志:
[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
推荐答案
要解决此问题,您必须手动将模型文件移至app目录中,然后将其添加到xcode-这似乎是将Xcode放入模型中的错误存储在应用程序包中另一个目录中的
To resolve this you have to manually move the model file into the app directory and then add it to xcode - it seems to be a bug in Xcode putting the model that is stored in another directory into the app package
这篇关于CoreML:“意外错误处理模型".有时会发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!