Post

Replies

Boosts

Views

Activity

Loading CoreML model increases app size?
Hi, i have been noticing some strange issues with using CoreML models in my app. I am using the Whisper.cpp implementation which has a coreML option. This speeds up the transcribing vs Metal. However every time i use it, the app size inside iphone settings -> General -> Storage increases - specifically the "documents and data" part, the bundle size stays consistent. The Size of the app seems to increase by the same size of the coreml model, and after a few reloads it can increase to over 3-4gb! I thought that maybe the coreml model (which is in the bundle) is being saved to file - but i can't see where, i have tried to use instruments and xcode plus lots of printing out of cache and temp directory etc, deleting the caches etc.. but no effect. I have downloaded the container of the iphone from xcode and inspected it, there are some files stored inthe cache but only a few kbs, and even though the value in the settings-> storage shows a few gb, the container is only a few mb. Please can someone help or give me some guidance on what to do to figure out why the documents and data is increasing? where could this folder be pointing to that is not in the xcode downloaded container?? This is the repo i am using https://github.com/ggerganov/whisper.cpp the swiftui app and objective-C app both do the same thing i am witnessing when using coreml. Thanks in advance for any help, i am totally baffled by this behaviour
1
1
305
May ’24
How to retrieve/save model after and during training
Hi I have been the following WWDC21 "dynamic training on iOS" - I have been able to get the training working, with an output of the iterations etc being printed out in the console as training progresses. However I am unable to retrieve the checkpoints or result/model once training has completed (or is in progress) nothing in the callback fires. If I try to create a model from the sessionDirectory - it returns nil (even though training has clearly completed). Please can someone help or provide pointers on how to access the results/checkpoints so that I can make a MlModel and use it. var subscriptions = [AnyCancellable]()         let job = try! MLStyleTransfer.train(trainingData: datasource, parameters: trainingParameters, sessionParameters: sessionParameters) job.result.sink { result in             print("result ", result)         }         receiveValue: { model in try? model.write(to: sessionDirectory)             let compiledURL = try? MLModel.compileModel(at: sessionDirectory)             let mlModel = try? MLModel(contentsOf: compiledURL!)         }         .store(in: &subscriptions) This also does not work: job.checkpoints.sink { checkpoint in // Process checkpoint  let model = MLStyleTransfer(trainingData: checkpoint) } .store(in: &subscriptions)         } This is the printout in the console: Using CPU to create model +--------------+--------------+--------------+--------------+--------------+ | Iteration    | Total Loss   | Style Loss   | Content Loss | Elapsed Time | +--------------+--------------+--------------+--------------+--------------+ | 1            | 64.9218      | 54.9499      | 9.97187      | 3.92s        | 2022-02-20 15:14:37.056251+0000 DynamicStyle[81737:9175431] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke | 2            | 61.7283      | 24.6832      | 8.30343      | 9.87s        | | 3            | 59.5098      | 27.7834      | 11.7603      | 16.19s       | | 4            | 56.2737      | 16.163       | 10.985       | 22.35s       | | 5            | 53.0747      | 12.2062      | 12.0783      | 28.08s       | +--------------+--------------+--------------+--------------+--------------+ Any help would be appreciated on how to retrieve models. Thanks
3
0
1.1k
Feb ’22
CreateMl style transfer vs Turicreate
Hi just a couple of questions about the new style transfer in Create ML. Does it use the same methods/underlying models as Turicreate to do the style transfer? Turicreate lets you use up to 8 styles at once (thus reducing the size of the produced MLmodel) i.e. you don''t need to create a MlModel for each style. Does the new CreateML style transfer have the same ability? Thanks
1
0
748
Jul ’20