Advertisement
Guest User

Untitled

a guest
Sep 13th, 2023
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.38 KB | None | 0 0
  1. Obtaining file:///Users/user/Documents/ml-stable-diffusion
  2. Preparing metadata (setup.py) ... done
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
  11. 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)
  12. 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)
  13. 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)
  14. 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)
  15. 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)
  16. 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)
  17. 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)
  18. 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)
  19. 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)
  20. 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)
  21. 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)
  22. 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)
  23. 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)
  24. 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)
  25. 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)
  26. 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)
  27. 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)
  28. 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)
  29. 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)
  30. 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)
  31. 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)
  32. 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)
  33. 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)
  34. 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)
  35. 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)
  36. 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)
  37. 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)
  38. 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)
  39. 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)
  40. 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)
  41. 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)
  42. 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)
  43. 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)
  44. 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)
  45. 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)
  46. 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)
  47. 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)
  48. 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)
  49. 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)
  50. 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)
  51. 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)
  52. 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)
  53. 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)
  54. 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)
  55. 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)
  56. 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)
  57. 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)
  58. Installing collected packages: python-coreml-stable-diffusion
  59. Attempting uninstall: python-coreml-stable-diffusion
  60. Found existing installation: python-coreml-stable-diffusion 1.0.0
  61. Uninstalling python-coreml-stable-diffusion-1.0.0:
  62. Successfully uninstalled python-coreml-stable-diffusion-1.0.0
  63. Running setup.py develop for python-coreml-stable-diffusion
  64. Successfully installed python-coreml-stable-diffusion-1.0.0
  65. Requirement already satisfied: omegaconf in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (2.3.0)
  66. 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)
  67. 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)
  68. Requirement already satisfied: safetensors in /Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages (0.3.3)
  69. --------------------------------------------------------------------------------
  70. SD to Core ML script by φ Zabriskije
  71. --------------------------------------------------------------------------------
  72.  
  73. Enter model name: v1-5-pruned
  74. --------------------------------------------------------------------------------
  75. SD to Core ML script by φ Zabriskije
  76. --------------------------------------------------------------------------------
  77.  
  78. Model: v1-5-pruned
  79.  
  80. 1) CKPT → All
  81. 2) CKPT → Diffusers
  82. 3) SafeTensors → All
  83. 4) SafeTensors → Diffusers
  84. 5) Diffusers → ORIGINAL
  85. 6) Diffusers → ORIGINAL 512x768
  86. 7) Diffusers → ORIGINAL 768x512
  87. 8) Diffusers → SPLIT_EINSUM
  88. 9) Change model name
  89.  
  90. Pick a number: 3
  91.  
  92. [1/5] Converting v1-5-pruned to Diffusers...
  93.  
  94. Checkpoint v1-5-pruned.safetensors has both EMA and non-EMA weights.
  95. 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.
  96. `text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
  97. `text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["bos_token_id"]` will be overriden.
  98. `text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["eos_token_id"]` will be overriden.
  99. /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.
  100. warnings.warn(
  101.  
  102. [1/5] Conversion of v1-5-pruned to Diffusers completed in 0min and 25s
  103.  
  104. [2/5] Converting v1-5-pruned to ORIGINAL...
  105.  
  106. 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.
  107. 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.
  108. INFO:__main__:Initializing StableDiffusionPipeline with v1-5-pruned_diffusers..
  109. 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.
  110. warnings.warn(
  111. Loading pipeline components...: 100%|█████████████| 7/7 [00:03<00:00, 1.81it/s]
  112. INFO:__main__:Done.
  113. INFO:__main__:Attention implementation in effect: AttentionImplementations.ORIGINAL
  114. INFO:__main__:Converting vae_decoder
  115. /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!
  116. assert hidden_states.shape[1] == self.channels
  117. /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!
  118. if hidden_states.shape[0] >= 64:
  119. INFO:__main__:Converting vae_decoder to CoreML..
  120. Converting PyTorch Frontend ==> MIL Ops: 100%|▉| 368/369 [00:00<00:00, 4158.05 o
  121. Running MIL frontend_pytorch pipeline: 100%|█| 5/5 [00:00<00:00, 385.05 passes/s
  122. Running MIL default pipeline: 100%|████████| 64/64 [00:03<00:00, 16.62 passes/s]
  123. Running MIL backend_mlprogram pipeline: 100%|█| 11/11 [00:00<00:00, 598.44 passe
  124. INFO:__main__:Saved vae_decoder model to v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_decoder.mlpackage
  125. INFO:__main__:Saved vae_decoder into v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_decoder.mlpackage
  126. INFO:__main__:Converted vae_decoder
  127. INFO:__main__:Converting vae_encoder
  128. /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!
  129. assert hidden_states.shape[1] == self.channels
  130. /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!
  131. assert hidden_states.shape[1] == self.channels
  132. INFO:__main__:Converting vae_encoder to CoreML..
  133. Converting PyTorch Frontend ==> MIL Ops: 100%|▉| 295/296 [00:00<00:00, 4919.86 o
  134. Running MIL frontend_pytorch pipeline: 100%|█| 5/5 [00:00<00:00, 563.11 passes/s
  135. Running MIL default pipeline: 100%|████████| 64/64 [00:02<00:00, 27.19 passes/s]
  136. Running MIL backend_mlprogram pipeline: 100%|█| 11/11 [00:00<00:00, 784.46 passe
  137. INFO:__main__:Saved vae_encoder model to v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_encoder.mlpackage
  138. INFO:__main__:Saved vae_encoder into v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_vae_encoder.mlpackage
  139. INFO:__main__:Converted vae_encoder
  140. INFO:__main__:Converting unet
  141. /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'.
  142. args.text_encoder_hidden_size or pipe.unet.cross_attention_dim or pipe.text_encoder.config.hidden_size,
  143. 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)}
  144. INFO:__main__:JIT tracing..
  145. /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!
  146. assert inputs.size(1) == self.num_channels
  147. INFO:__main__:Done.
  148. INFO:__main__:Converting unet to CoreML..
  149. WARNING:coremltools:Tuple detected at graph output. This will be flattened in the converted model.
  150. 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!
  151. Converting PyTorch Frontend ==> MIL Ops: 100%|▉| 3398/3400 [00:00<00:00, 4737.51
  152. Running MIL frontend_pytorch pipeline: 100%|█| 5/5 [00:00<00:00, 24.04 passes/s]
  153. Running MIL default pipeline: 100%|████████| 64/64 [01:12<00:00, 1.14s/ passes]
  154. Running MIL backend_mlprogram pipeline: 100%|█| 11/11 [00:00<00:00, 110.07 passe
  155. INFO:__main__:Saved unet model to v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_unet.mlpackage
  156. INFO:__main__:Saved unet into v1-5-pruned_original/Stable_Diffusion_version_v1-5-pruned_diffusers_unet.mlpackage
  157. INFO:__main__:Converted unet
  158. INFO:__main__:Converting text_encoder
  159. INFO:__main__:Sample inputs spec: {'input_ids': (torch.Size([1, 77]), torch.float32)}
  160. INFO:__main__:JIT tracing text_encoder..
  161. /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.
  162. mask = torch.full((tgt_len, tgt_len), torch.tensor(-1e4, device=device), device=device)
  163. /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!
  164. if attn_weights.size() != (bsz * self.num_heads, tgt_len, src_len):
  165. /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!
  166. if causal_attention_mask.size() != (bsz, 1, tgt_len, src_len):
  167. /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!
  168. if attn_output.size() != (bsz * self.num_heads, tgt_len, self.head_dim):
  169. INFO:__main__:Done.
  170. INFO:__main__:Converting text_encoder to CoreML..
  171. WARNING:coremltools:Tuple detected at graph output. This will be flattened in the converted model.
  172. 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!
  173. Converting PyTorch Frontend ==> MIL Ops: 5%| | 41/833 [00:00<00:00, 7818.08 op
  174. Traceback (most recent call last):
  175. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/runpy.py", line 194, in _run_module_as_main
  176. return _run_code(code, main_globals, None,
  177. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/runpy.py", line 87, in _run_code
  178. exec(code, run_globals)
  179. File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 1427, in <module>
  180. main(args)
  181. File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 1272, in main
  182. convert_text_encoder(pipe.text_encoder, pipe.tokenizer, "text_encoder", args)
  183. File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 356, in convert_text_encoder
  184. coreml_text_encoder, out_path = _convert_to_coreml(
  185. File "/Users/user/Documents/ml-stable-diffusion/python_coreml_stable_diffusion/torch2coreml.py", line 122, in _convert_to_coreml
  186. coreml_model = ct.convert(
  187. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/_converters_entry.py", line 530, in convert
  188. mlmodel = mil_convert(
  189. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/converter.py", line 188, in mil_convert
  190. return _mil_convert(model, convert_from, convert_to, ConverterRegistry, MLModel, compute_units, **kwargs)
  191. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/converter.py", line 212, in _mil_convert
  192. proto, mil_program = mil_convert_to_proto(
  193. 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
  194. prog = frontend_converter(model, **kwargs)
  195. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/converter.py", line 108, in __call__
  196. return load(*args, **kwargs)
  197. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/frontend/torch/load.py", line 63, in load
  198. return _perform_torch_convert(converter, debug)
  199. 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
  200. prog = converter.convert()
  201. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/frontend/torch/converter.py", line 439, in convert
  202. convert_nodes(self.context, self.graph)
  203. 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
  204. add_op(context, node)
  205. 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
  206. res = mb.select(cond=mask, a=value, b=x, name=node.name)
  207. 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
  208. return cls._add_op(op_cls_to_add, **kwargs)
  209. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/mil/builder.py", line 166, in _add_op
  210. new_op = op_cls(**kwargs)
  211. File "/Users/user/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/site-packages/coremltools/converters/mil/mil/operation.py", line 187, in __init__
  212. self._validate_and_set_inputs(input_kv)
  213. 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
  214. self.input_spec.validate_inputs(self.name, self.op_type, input_kvs)
  215. 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
  216. raise ValueError(msg)
  217. 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