You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using the torch2coreml script with the --chunk-unet option would result in the following error:
AttributeError: 'CacheDoublyLinkedList' object has no attribute 'index'. This error occurred because the index attribute has been removed from the CacheDoublyLinkedList class in the latest versions of coremltools.:apple/ml-stable-diffusion#327
Stack Trace
If applicable, please paste the complete stack trace.
# Paste Python code snippet here, complete with any required import statements.
If the model conversion succeeds, but there is a numerical mismatch in predictions, please include the code used for comparisons.
System environment (please complete the following information):
coremltools version:
OS (e.g. MacOS version or Linux type):
Any other relevant version information (e.g. PyTorch or TensorFlow version):
(Pdb) main_block.operations
<coremltools.converters.mil.mil.utils.CacheDoublyLinkedList object at 0x7fe93c0d7c70>
(Pdb) p coremltools.converters.mil.mil.utils.CacheDoublyLinkedList
*** NameError: name 'coremltools' is not defined
(Pdb) c
Traceback (most recent call last):
File "/workspace/pixart.py", line 266, in <module>
main()
File "/workspace/pixart.py", line 191, in main
op_idx, first_chunk_weights_size, total_weights_size = _get_op_idx_split_location(
File "/opt/conda/envs/mobile_t2i/lib/python3.9/site-packages/python_coreml_stable_diffusion/chunk_mlprogram.py", line 94, in _get_op_idx_split_location
for op in main_block.operations:
AttributeError: 'CacheDoublyLinkedList' object has no attribute 'index'
Additional context
Add anything else about the problem here that you want to share.
class CacheDoublyLinkedList:
# ... [rest of your class definition] ...
def index(self, op: Operation) -> int:
"""
Find the index of an operation in the linked list.
"""
cursor = self.start
idx = 0
while cursor is not None:
if cursor.op == op:
return idx
cursor = cursor.next
idx += 1
raise ValueError(f"{op} is not in the list")
maybe something like this to use .index over the linked list
🐞Describing the bug
using the torch2coreml script with the --chunk-unet option would result in the following error:
AttributeError: 'CacheDoublyLinkedList' object has no attribute 'index'. This error occurred because the index attribute has been removed from the CacheDoublyLinkedList class in the latest versions of coremltools.:apple/ml-stable-diffusion#327
Stack Trace
To Reproduce
use coreml==7.2 and try to run https://github.com/apple/ml-stable-diffusion?tab=readme-ov-file#-converting-models-to-core-ml
python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --convert-safety-checker --model-version <model-version-string-from-hub> -o <output-mlpackages-directory>
System environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: