• 0 Posts
  • 3 Comments
Joined 1 year ago
cake
Cake day: December 30th, 2023

help-circle
  • This is a great minimal example! You’re on the right track regarding the input, it’s just that coreml expects the input shape to be fully defined, meaning it must be a 2D tensor of (batch_size, sequence_length).

    If you change the conversion inputs line to be

    inputs=[ct.TensorType(shape=(32, max_len), name="embedding_input", dtype=np.int32)],

    instead of a 1-dimensional tensor you should be fine.

    Also you may need to use mlpackage instead of mlmodel for the file extension.