Skip to content

I cant run it #1

Open
Open

Description

@WarlockZhang

When it runs to the line sd.LoadModel(sdModelPath, vaeModelPath, vocabPath, mergesPath);, it reports an error: System.InvalidOperationException: "Sequence contains no matching element".Below is the call stack—where did the issue occur? System.Linq.dll!System.Linq.ThrowHelper.ThrowNoMatchException()
System.Linq.dll!System.Linq.Enumerable.First<StableDiffusionSharp.ModelLoader.TensorInfo>(System.Collections.Generic.IEnumerable<StableDiffusionSharp.ModelLoader.TensorInfo> source, System.Func<StableDiffusionSharp.ModelLoader.TensorInfo, bool> predicate)
StableDiffusionSharp.dll!StableDiffusionSharp.ModelLoader.SafetensorsLoader.LoadSafetensors(TorchSharp.torch.nn.Module module, string fileName, string maybeAddHeaderInBlock)
StableDiffusionSharp.dll!StableDiffusionSharp.ModelLoader.ModelLoader.LoadModel(TorchSharp.torch.nn.Module module, string fileName, string maybeAddHeaderInBlock)
StableDiffusionSharp.dll!StableDiffusionSharp.Modules.SDModel.LoadModel(string modelPath, string vaeModelPath, string vocabPath, string mergesPath)
StableDiffusionSharp.dll!StableDiffusionSharp.StableDiffusion.LoadModel(string modelPath, string vaeModelPath, string vocabPath, string mergesPath)

Activity

  1. IntptrMax commented on Apr 28, 2025

    @IntptrMax
    Owner

    When it runs to the line sd.LoadModel(sdModelPath, vaeModelPath, vocabPath, mergesPath);, it reports an error: System.InvalidOperationException: "Sequence contains no matching element".Below is the call stack—where did the issue occur? System.Linq.dll!System.Linq.ThrowHelper.ThrowNoMatchException() System.Linq.dll!System.Linq.Enumerable.First<StableDiffusionSharp.ModelLoader.TensorInfo>(System.Collections.Generic.IEnumerable<StableDiffusionSharp.ModelLoader.TensorInfo> source, System.Func<StableDiffusionSharp.ModelLoader.TensorInfo, bool> predicate) StableDiffusionSharp.dll!StableDiffusionSharp.ModelLoader.SafetensorsLoader.LoadSafetensors(TorchSharp.torch.nn.Module module, string fileName, string maybeAddHeaderInBlock) StableDiffusionSharp.dll!StableDiffusionSharp.ModelLoader.ModelLoader.LoadModel(TorchSharp.torch.nn.Module module, string fileName, string maybeAddHeaderInBlock) StableDiffusionSharp.dll!StableDiffusionSharp.Modules.SDModel.LoadModel(string modelPath, string vaeModelPath, string vocabPath, string mergesPath) StableDiffusionSharp.dll!StableDiffusionSharp.StableDiffusion.LoadModel(string modelPath, string vaeModelPath, string vocabPath, string mergesPath)

    StableDiffusionSharp now only support SD1.5 and SDXL model. Please check your model first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions