# HG changeset patch # User Chris Cannam # Date 1563196357 -3600 # Node ID 110f853c31493a79138c8a748e9ab2ee197dc0ba # Parent ee7fd2c01d877573229c8b92eb172f1e98aa4d68 Deleted-model checks, & debug output diff -r ee7fd2c01d87 -r 110f853c3149 transform/FeatureExtractionModelTransformer.cpp --- a/transform/FeatureExtractionModelTransformer.cpp Fri Jul 12 13:57:42 2019 +0100 +++ b/transform/FeatureExtractionModelTransformer.cpp Mon Jul 15 14:12:37 2019 +0100 @@ -770,10 +770,35 @@ ((((blockFrame - contextStart) / stepSize) * 99) / (contextDuration / stepSize + 1)); + bool haveAllModels = true; if (!ModelById::get(inputId)) { +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::run: Input model " << inputId << " no longer exists" << endl; +#endif + haveAllModels = false; + } else { + SVDEBUG << "Input model " << inputId << " still exists" << endl; + } + for (auto mid: m_outputs) { + if (!ModelById::get(mid)) { +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::run: Output model " << mid << " no longer exists" << endl; +#endif + haveAllModels = false; + } else { +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "Output model " << mid << " still exists" << endl; +#endif + } + } + if (!haveAllModels) { abandon(); - return; + break; } + +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::run: All models still exist" << endl; +#endif // channelCount is either input->channelCount or 1 @@ -838,6 +863,9 @@ for (int fi = 0; in_range_for(features[m_outputNos[j]], fi); ++fi) { auto feature = features[m_outputNos[j]][fi]; addFeature(j, blockFrame, feature); + if (m_abandoned) { + break; + } } } } @@ -1109,9 +1137,11 @@ } else { model->setColumn(int(frame / model->getResolution()), values); } + } else { + + SVDEBUG << "FeatureExtractionModelTransformer::addFeature: Unknown output model type - possibly a deleted model" << endl; + abandon(); } - - SVDEBUG << "FeatureExtractionModelTransformer::addFeature: Unknown output model type!" << endl; } void