Skip to content

Unsupported type in MLMultiArray when running with Swift CLI #253

Closed
@davidw0311

Description

@davidw0311

Error:
CoreML/MLShapedArray.swift:557: Fatal error: MLMultiArray of data type Float16 is not supported.

After generation of the model in using

python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --model-version runwayml/stable-diffusion-v1-5 --bundle-resources-for-swift-cli --attention-implementation SPLIT_EINSUM -o swift-original-coreml-sd-v1-5

and running with

swift run StableDiffusionSample "a photo of an astronaut riding a horse on mars" --resource-path swift-original-coreml-sd-v1-5/Resources/ --seed 93 --output-path swift_images

the above error occurs.

Seems to be occuring during execution of line line 89 in TextEncoder.swift StableDiffusion/pipeline/TextEncoder.swift

return MLShapedArray<Float32>(converting: embeddingFeature!.multiArrayValue!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions