[Python] Importing the Attention package in Keras gives ModuleNotFoundError: No module named...

Discussão em 'Python' iniciado por Stack, Fevereiro 1, 2025.

  1. Stack

    Stack Membro Participativo

    As part of my imports, I am importing the AttentionLayer package as follows:

    from attention import AttentionLayer


    I get the following error:

    ModuleNotFoundError: No module named 'attention'


    I figured this might be because I need to pip install it so I tried based on other answers I found online a few pip installs I tried were:

    pip install AttentionLayer
    pip install Attention
    pip install keras-self-attention


    All 3 of those give me:

    Could not find a version that satisfies the requirement keras-self-attention (from versions: ) No Matching distribution found for....


    Why am I not getting it to work and how can I fix it?

    I have a suspicion that it might be related to setting the pythonpath but I do not have admin rights to edit this at work.

    Thank you.

    Continue reading...

Compartilhe esta Página