Skip to content

cannot import name 'CachedMultiHeadAttention' from partially initialized module 'keras_nlp.src.layers.modeling.cached_multi_head_attention' (most likely due to a circular import) #1427

Open
@anilmamidwar15021991

Description

@anilmamidwar15021991

I am getting below error when i run my python script dealing with importing keras_nlp.

cannot import name 'CachedMultiHeadAttention' from partially initialized module 'keras_nlp.src.layers.modeling.cached_multi_head_attention' (most likely due to a circular import)

Below is the code snippet
import os
os.environ["KERAS_BACKEND"]="torch"
import keras_core as core
import keras_nlp
import keras_core.backend as k
import tensorflow as tf

i am using keras_nlp version 0.7.0 , tensorflow version 2.13.1 , keras core version 0.1.7 and keras version 2.13.1

please assist , invested quite good amount of time on all possible interest approaches but still not working.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions