Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Obtaining file:///Users/user/Documents/ml-stable-diffusion
- Preparing metadata (setup.py) ... done
- Requirement already satisfied: coremltools==7.0b1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (7.0b1)
- Requirement already satisfied: diffusers[torch] in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (0.20.1)
- Requirement already satisfied: torch in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (2.0.1)
- Requirement already satisfied: transformers>=4.30.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (4.32.1)
- Requirement already satisfied: huggingface-hub in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (0.16.4)
- Requirement already satisfied: scipy in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (1.10.1)
- Requirement already satisfied: numpy<1.24 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (1.23.5)
- Requirement already satisfied: pytest in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (7.4.0)
- Requirement already satisfied: scikit-learn in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (1.3.0)
- Requirement already satisfied: invisible-watermark in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (0.2.0)
- Requirement already satisfied: safetensors in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (0.3.3)
- Requirement already satisfied: matplotlib in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-coreml-stable-diffusion==1.0.0) (3.7.2)
- Requirement already satisfied: protobuf<=4.0.0,>=3.1.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (3.20.3)
- Requirement already satisfied: sympy in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (1.12)
- Requirement already satisfied: tqdm in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (4.66.1)
- Requirement already satisfied: packaging in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (23.1)
- Requirement already satisfied: attrs in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (23.1.0)
- Requirement already satisfied: cattrs in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (23.1.2)
- Requirement already satisfied: pyaml in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (23.7.0)
- Requirement already satisfied: filelock in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (3.12.3)
- Requirement already satisfied: pyyaml>=5.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (6.0.1)
- Requirement already satisfied: regex!=2019.12.17 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (2023.8.8)
- Requirement already satisfied: requests in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (2.31.0)
- Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (0.13.3)
- Requirement already satisfied: fsspec in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from huggingface-hub->python-coreml-stable-diffusion==1.0.0) (2023.6.0)
- Requirement already satisfied: typing-extensions>=3.7.4.3 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from huggingface-hub->python-coreml-stable-diffusion==1.0.0) (4.7.1)
- Requirement already satisfied: importlib-metadata in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from diffusers[torch]->python-coreml-stable-diffusion==1.0.0) (6.8.0)
- Requirement already satisfied: Pillow in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from diffusers[torch]->python-coreml-stable-diffusion==1.0.0) (10.0.0)
- Requirement already satisfied: accelerate>=0.11.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from diffusers[torch]->python-coreml-stable-diffusion==1.0.0) (0.22.0)
- Requirement already satisfied: networkx in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from torch->python-coreml-stable-diffusion==1.0.0) (3.1)
- Requirement already satisfied: jinja2 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from torch->python-coreml-stable-diffusion==1.0.0) (3.1.2)
- Requirement already satisfied: PyWavelets>=1.1.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from invisible-watermark->python-coreml-stable-diffusion==1.0.0) (1.4.1)
- Requirement already satisfied: opencv-python>=4.1.0.25 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from invisible-watermark->python-coreml-stable-diffusion==1.0.0) (4.8.0.76)
- Requirement already satisfied: contourpy>=1.0.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from matplotlib->python-coreml-stable-diffusion==1.0.0) (1.1.0)
- Requirement already satisfied: cycler>=0.10 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from matplotlib->python-coreml-stable-diffusion==1.0.0) (0.11.0)
- Requirement already satisfied: fonttools>=4.22.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from matplotlib->python-coreml-stable-diffusion==1.0.0) (4.42.1)
- Requirement already satisfied: kiwisolver>=1.0.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from matplotlib->python-coreml-stable-diffusion==1.0.0) (1.4.5)
- Requirement already satisfied: pyparsing<3.1,>=2.3.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from matplotlib->python-coreml-stable-diffusion==1.0.0) (3.0.9)
- Requirement already satisfied: python-dateutil>=2.7 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from matplotlib->python-coreml-stable-diffusion==1.0.0) (2.8.2)
- Requirement already satisfied: importlib-resources>=3.2.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from matplotlib->python-coreml-stable-diffusion==1.0.0) (6.0.1)
- Requirement already satisfied: iniconfig in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from pytest->python-coreml-stable-diffusion==1.0.0) (2.0.0)
- Requirement already satisfied: pluggy<2.0,>=0.12 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from pytest->python-coreml-stable-diffusion==1.0.0) (1.3.0)
- Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from pytest->python-coreml-stable-diffusion==1.0.0) (1.1.3)
- Requirement already satisfied: tomli>=1.0.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from pytest->python-coreml-stable-diffusion==1.0.0) (2.0.1)
- Requirement already satisfied: joblib>=1.1.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from scikit-learn->python-coreml-stable-diffusion==1.0.0) (1.3.2)
- Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from scikit-learn->python-coreml-stable-diffusion==1.0.0) (3.2.0)
- Requirement already satisfied: psutil in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from accelerate>=0.11.0->diffusers[torch]->python-coreml-stable-diffusion==1.0.0) (5.9.5)
- Requirement already satisfied: zipp>=3.1.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from importlib-resources>=3.2.0->matplotlib->python-coreml-stable-diffusion==1.0.0) (3.16.2)
- Requirement already satisfied: six>=1.5 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from python-dateutil>=2.7->matplotlib->python-coreml-stable-diffusion==1.0.0) (1.16.0)
- Requirement already satisfied: MarkupSafe>=2.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from jinja2->torch->python-coreml-stable-diffusion==1.0.0) (2.1.3)
- Requirement already satisfied: charset-normalizer<4,>=2 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from requests->transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (3.2.0)
- Requirement already satisfied: idna<4,>=2.5 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from requests->transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (3.4)
- Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from requests->transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (2.0.4)
- Requirement already satisfied: certifi>=2017.4.17 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from requests->transformers>=4.30.0->python-coreml-stable-diffusion==1.0.0) (2023.7.22)
- Requirement already satisfied: mpmath>=0.19 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from sympy->coremltools==7.0b1->python-coreml-stable-diffusion==1.0.0) (1.3.0)
- Installing collected packages: python-coreml-stable-diffusion
- Attempting uninstall: python-coreml-stable-diffusion
- Found existing installation: python-coreml-stable-diffusion 1.0.0
- Uninstalling python-coreml-stable-diffusion-1.0.0:
- Successfully uninstalled python-coreml-stable-diffusion-1.0.0
- Running setup.py develop for python-coreml-stable-diffusion
- Successfully installed python-coreml-stable-diffusion-1.0.0
- Requirement already satisfied: omegaconf in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (2.3.0)
- Requirement already satisfied: antlr4-python3-runtime==4.9.* in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from omegaconf) (4.9.3)
- Requirement already satisfied: PyYAML>=5.1.0 in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (from omegaconf) (6.0.1)
- Requirement already satisfied: safetensors in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (0.3.3)
- --------------------------------------------------------------------------------
- SD to Core ML script by φ Zabriskije
- --------------------------------------------------------------------------------
- Enter model name: v1-5-pruned
- --------------------------------------------------------------------------------
- SD to Core ML script by φ Zabriskije
- --------------------------------------------------------------------------------
- Model: v1-5-pruned
- 1) CKPT → All
- 2) CKPT → Diffusers
- 3) SafeTensors → All
- 4) SafeTensors → Diffusers
- 5) Diffusers → ORIGINAL
- 6) Diffusers → ORIGINAL 512x768
- 7) Diffusers → ORIGINAL 768x512
- 8) Diffusers → SPLIT_EINSUM
- 9) Change model name
- Pick a number: 3
- [1/5] Converting v1-5-pruned to Diffusers...
- Checkpoint v1-5-pruned.safetensors has both EMA and non-EMA weights.
- In this conversion only the EMA weights are extracted. If you want to instead extract the non-EMA weights (useful to continue fine-tuning), please make sure to remove the `--extract_ema` flag.
- `text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
- `text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["bos_token_id"]` will be overriden.
- `text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["eos_token_id"]` will be overriden.
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/transformers/models/clip/feature_extraction_clip.py:28: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
- warnings.warn(
- [1/5] Conversion of v1-5-pruned to Diffusers completed in 0min and 25s
- [2/5] Converting v1-5-pruned to ORIGINAL...
- scikit-learn version 1.3.0 is not supported. Minimum required version: 0.17. Maximum required version: 1.1.2. Disabling scikit-learn conversion API.
- Torch version 2.0.1 has not been tested with coremltools. You may run into unexpected errors. Torch 2.0.0 is the most recent version that has been tested.
- INFO:__main__:Initializing StableDiffusionPipeline with v1-5-pruned_diffusers..
- Loading pipeline components...: 29%|███▋ | 2/7 [00:00<00:00, 11.39it/s]/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/transformers/models/clip/feature_extraction_clip.py:28: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
- warnings.warn(
- Loading pipeline components...: 100%|█████████████| 7/7 [00:03<00:00, 1.81it/s]
- INFO:__main__:Done.
- INFO:__main__:Attention implementation in effect: AttentionImplementations.ORIGINAL
- INFO:__main__:Converting vae_decoder
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/diffusers/models/resnet.py:139: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- assert hidden_states.shape[1] == self.channels
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/diffusers/models/resnet.py:152: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- if hidden_states.shape[0] >= 64:
- INFO:__main__:Converting vae_decoder to CoreML..
- Converting PyTorch Frontend ==> MIL Ops: 100%|▉| 368/369 [00:00<00:00, 4158.05 o
- Running MIL frontend_pytorch pipeline: 100%|█| 5/5 [00:00<00:00, 385.05 passes/s
- Running MIL default pipeline: 100%|████████| 64/64 [00:03<00:00, 16.62 passes/s]
- Running MIL backend_mlprogram pipeline: 100%|█| 11/11 [00:00<00:00, 598.44 passe
- INFO:__main__:Saved vae_decoder model to v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_decoder.mlpackage
- INFO:__main__:Saved vae_decoder into v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_decoder.mlpackage
- INFO:__main__:Converted vae_decoder
- INFO:__main__:Converting vae_encoder
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/diffusers/models/resnet.py:215: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- assert hidden_states.shape[1] == self.channels
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/diffusers/models/resnet.py:220: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- assert hidden_states.shape[1] == self.channels
- INFO:__main__:Converting vae_encoder to CoreML..
- Converting PyTorch Frontend ==> MIL Ops: 100%|▉| 295/296 [00:00<00:00, 4919.86 o
- Running MIL frontend_pytorch pipeline: 100%|█| 5/5 [00:00<00:00, 563.11 passes/s
- Running MIL default pipeline: 100%|████████| 64/64 [00:02<00:00, 27.19 passes/s]
- Running MIL backend_mlprogram pipeline: 100%|█| 11/11 [00:00<00:00, 784.46 passe
- INFO:__main__:Saved vae_encoder model to v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_encoder.mlpackage
- INFO:__main__:Saved vae_encoder into v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_encoder.mlpackage
- INFO:__main__:Converted vae_encoder
- INFO:__main__:Converting unet
- /Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py:679: FutureWarning: Accessing config attribute `cross_attention_dim` directly via 'UNet2DConditionModel' object attribute is deprecated. Please access 'cross_attention_dim' over 'UNet2DConditionModel's config object instead, e.g. 'unet.config.cross_attention_dim'.
- args.text_encoder_hidden_size or pipe.unet.cross_attention_dim or pipe.text_encoder.config.hidden_size,
- INFO:__main__:Sample UNet inputs spec: {'sample': (torch.Size([2, 4, 64, 64]), torch.float32), 'timestep': (torch.Size([2]), torch.float32), 'encoder_hidden_states': (torch.Size([2, 768, 1, 77]), torch.float32)}
- INFO:__main__:JIT tracing..
- /Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/layer_norm.py:61: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- assert inputs.size(1) == self.num_channels
- INFO:__main__:Done.
- INFO:__main__:Converting unet to CoreML..
- WARNING:coremltools:Tuple detected at graph output. This will be flattened in the converted model.
- Converting PyTorch Frontend ==> MIL Ops: 0%| | 0/3400 [00:00<?, ? ops/s]WARNING:coremltools:Saving value type of int64 into a builtin type of int32, might lose precision!
- Converting PyTorch Frontend ==> MIL Ops: 100%|▉| 3398/3400 [00:00<00:00, 4737.51
- Running MIL frontend_pytorch pipeline: 100%|█| 5/5 [00:00<00:00, 24.04 passes/s]
- Running MIL default pipeline: 100%|████████| 64/64 [01:12<00:00, 1.14s/ passes]
- Running MIL backend_mlprogram pipeline: 100%|█| 11/11 [00:00<00:00, 110.07 passe
- INFO:__main__:Saved unet model to v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_unet.mlpackage
- INFO:__main__:Saved unet into v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_unet.mlpackage
- INFO:__main__:Converted unet
- INFO:__main__:Converting text_encoder
- INFO:__main__:Sample inputs spec: {'input_ids': (torch.Size([1, 77]), torch.float32)}
- INFO:__main__:JIT tracing text_encoder..
- /Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py:282: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
- mask = torch.full((tgt_len, tgt_len), torch.tensor(-1e4, device=device), device=device)
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:287: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- if attn_weights.size() != (bsz * self.num_heads, tgt_len, src_len):
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:295: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- if causal_attention_mask.size() != (bsz, 1, tgt_len, src_len):
- /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:327: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
- if attn_output.size() != (bsz * self.num_heads, tgt_len, self.head_dim):
- INFO:__main__:Done.
- INFO:__main__:Converting text_encoder to CoreML..
- WARNING:coremltools:Tuple detected at graph output. This will be flattened in the converted model.
- Converting PyTorch Frontend ==> MIL Ops: 0%| | 0/833 [00:00<?, ? ops/s]WARNING:coremltools:Saving value type of int64 into a builtin type of int32, might lose precision!
- Converting PyTorch Frontend ==> MIL Ops: 5%| | 41/833 [00:00<00:00, 7818.08 op
- Traceback (most recent call last):
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/runpy.py", line 194, in _run_module_as_main
- return _run_code(code, main_globals, None,
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/runpy.py", line 87, in _run_code
- exec(code, run_globals)
- File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 1427, in <module>
- main(args)
- File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 1272, in main
- convert_text_encoder(pipe.text_encoder, pipe.tokenizer, "text_encoder", args)
- File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 356, in convert_text_encoder
- coreml_text_encoder, out_path = _convert_to_coreml(
- File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 122, in _convert_to_coreml
- coreml_model = ct.convert(
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/_converters_entry.py", line 530, in convert
- mlmodel = mil_convert(
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/converter.py", line 188, in mil_convert
- return _mil_convert(model, convert_from, convert_to, ConverterRegistry, MLModel, compute_units, **kwargs)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/converter.py", line 212, in _mil_convert
- proto, mil_program = mil_convert_to_proto(
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/converter.py", line 286, in mil_convert_to_proto
- prog = frontend_converter(model, **kwargs)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/converter.py", line 108, in __call__
- return load(*args, **kwargs)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/frontend/torch/load.py", line 63, in load
- return _perform_torch_convert(converter, debug)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/frontend/torch/load.py", line 102, in _perform_torch_convert
- prog = converter.convert()
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/frontend/torch/converter.py", line 439, in convert
- convert_nodes(self.context, self.graph)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/frontend/torch/ops.py", line 92, in convert_nodes
- add_op(context, node)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/frontend/torch/ops.py", line 4216, in masked_fill
- res = mb.select(cond=mask, a=value, b=x, name=node.name)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/mil/ops/registry.py", line 183, in add_op
- return cls._add_op(op_cls_to_add, **kwargs)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/mil/builder.py", line 166, in _add_op
- new_op = op_cls(**kwargs)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/mil/operation.py", line 187, in __init__
- self._validate_and_set_inputs(input_kv)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/mil/operation.py", line 495, in _validate_and_set_inputs
- self.input_spec.validate_inputs(self.name, self.op_type, input_kvs)
- File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/mil/input_type.py", line 137, in validate_inputs
- raise ValueError(msg)
- ValueError: In op, of type select, named mask.3, the named input `b` must have the same data type as the named input `a`. However, b has dtype fp32 whereas a has dtype int32.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement