Cannot find reference ‘attention‘ in ‘__init__.py‘

Insert image description here


Problem Description:

When using from torch_geometric.nn import attentionthis command, the module cannot be found suddenly and an error message appears.Cannot find reference 'attention' in '__init__.py'

Cannot find reference 'attention' in '__init__.py'

Cause Analysis:

The reason for this problem is that your torch-geometricversion is too low and this module has not been introduced yet.


solution:

Just update your torch-geometricto the latest or to 2.4.0+ or ​​above.

pip install -U torch-geometric

Guess you like

Origin blog.csdn.net/m0_47256162/article/details/135458212