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

在这里插入图片描述


问题描述:

当使用 from torch_geometric.nn import attention 这条指令时突然找不到这个模块,出现 Cannot find reference 'attention' in '__init__.py'

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

原因分析:

出现这个问题的原因就是你的 torch-geometric 的版本太低了,目前还没有引入这个模块


解决方案:

将你的 torch-geometric 更新到最新或者更新到 2.4.0+以上即可。

pip install -U torch-geometric

猜你喜欢

转载自blog.csdn.net/m0_47256162/article/details/135458212