Posts

Post not yet marked as solved
261 Views

"Training stopped" error when trying to train a SoundClassifier on Create ML

I'm trying to train a sound classifier on create ML to recognise a particular sound. I've created a small dataset by collecting noise in the environment the classifier will be used and the sound itself. When I try to train the data collected (60 data points for training and 52 for testing, for now) it says "training progress is unavailable" and the status bar says that the "training stopped". I've made sure I've added at least 50 data points for testing and training. Where am I going wrong? Is it necessary for all data points to be of the same length?
Asked Last updated
.
Post marked as solved
370 Views

Unable to create View extension; custom view modifiers

I'm trying to create an extension to View to easily apply my custom view modifier. Below is the code for my custom viewModifier. import SwiftUI struct AnimatableFontModifier: AnimatableModifier{     var fontSize: CGFloat     var animatableData: CGFloat{         get{             fontSize         }         set{             fontSize = newValue         }     }     func body(content: Content) -> some View {         content.font(Font.system(size: fontSize))     } } extension View {     func AnimatableFontModifier(fontSize: CGFloat) -> some View{         self.modifier(AnimatableFontModifier(fontSize: fontSize))     } } This gives an error Return type of instance method 'AnimatableFontModifier(fontSize:)' requires that 'some View' conform to 'ViewModifier' But AnimatableFontModifier does confirm to the AnimatableModifier protocol, so where am I going wrong?
Asked Last updated
.