The initializer that you are using when you initialize your Resnet50 model, Resnet50()
, which is also equivalent to Resnet50.init()
, is deprecated, and so you are being shown a deprecation warning by Xcode.
The warning suggests the init(configuration:)
initializer as the replacement. To use that initializer, you would need to provide an MLConfiguration, you might do something like the following:
var config = MLModelConfiguration()
// Set any properties on the configuration here if you don't want to use the default configuration.
// Pass the configuration in to the initializer.
do {
let resnet = try Resnet50(configuration: config)
// Use the model if init was successful.
} catch {
// Handle the error if any.
fatalError(error.localizedDescription)
}