[Python] came across error about attention in the last yolo version

Discussão em 'Python' iniciado por Stack, Maio 14, 2025.

  1. Stack

    Stack Membro Participativo

    when i want to use YOLO12 in inference, i get this error.

    ---------------------------------------------------------------------------

    AttributeError Traceback (most recent call last)

    <ipython-input-16-65468ee2f515> in <cell line: 0>()
    ----> 1 results_yolo_n = yolo_s(images_path[0])

    25 frames

    /usr/local/lib/python3.11/dist-packages/torch/nn/modules/module.py in __getattr__(self, name)
    1926 if name in modules:
    1927 return modules[name]
    -> 1928 raise AttributeError(
    1929 f"'{type(self).__name__}' object has no attribute '{name}'"
    1930 )

    AttributeError: 'AAttn' object has no attribute 'qk'


    here is my code:

    ! pip install -q git+https://github.com/sunsmarterjie/yolov12.git ultralytics supervision
    import os
    import random
    from ultralytics import YOLO
    import supervision as sv
    yolo_l = YOLO("yolo12l.pt")
    results_yolo_l = yolo_l(image_paths[0])


    here i gave the yolo image path's,when i use actual image, i get the same error. i will be grateful if anyone could help me.

    i have tried a YOLO version 12 (Turbo) for detection task, i came across a wired error. i am asking my peers for help.

    Continue reading...

Compartilhe esta Página