I might have found a workaround, which might just work for your cases as well. As indicated in my previous post, I tried working around the issue by not using VNImageRequestHandler, but rather by using the CoreML model's predictions directly. In that case, I still passed it a CGImage. The generated CoreML model classes though also expose methods that accept a CVPixelBuffer as input - and the crash occurs in a function that converts the CGImage to a CVPixelBuffer.
I put symbolic breakpoints at -[VNWeakTypeWrapperCollection addObject:droppingWeakZeroedObjects:], which was consistently called before this change, and is no longer called after creating the CVPixelBuffers manually.
I hope this may help others as well - and I hope the problem stays away with this. If I still get issues, will keep you posted.
Topic:
Machine Learning & AI
SubTopic:
General
Tags: