tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

No visible @interface for 'CandyInput' declares the selector 'initWith0:'

Open leonzfa opened this issue 6 years ago • 0 comments

I tried to convert the pytorch model to .onnx and then .mlmodel using object-c. The generated model is Cany.mlmodel. When I building the project, it raised the error No visible @interface for 'CandyInput' declares the selector 'initWith0:'.

I check the error and find that in the Candy.m file, I have

- (nullable CandyOutput *)predictionFrom_0:(CVPixelBufferRef)_0 error:(NSError * _Nullable * _Nullable)error {
    fnssInput *input_ = [[CandyInput alloc] initWith0:_0];
    return [self predictionFromFeatures:input_ error:error];
}

while in Candy.h file, I have

/// 0 as color (kCVPixelFormatType_32BGRA) image buffer, 1080 pixels wide by 1080 pixels high
@property (readwrite, nonatomic) CVPixelBufferRef _0;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWith_0:(CVPixelBufferRef)_0;
@end

They are not consistent with each other, i.e., one is initWith_0 and the other is initWith0. Can this problem can be resolved?

PS: the .mlmodel can work well using swift.

leonzfa avatar May 15 '19 18:05 leonzfa