[Treading pit] PGL error cannot import name 'paddle_helper' from 'pgl.utils'

        The error is as follows:

        By checking the official Github, we can find that this is actually in the old version :

         The new version should be this:

# from pgl.utils import paddle_helper
from pgl.utils import helper

        But comparing the content, it is found that the content inside is still quite large. You can manually copy the past if necessary.

Legacy: https://github.com/PaddlePaddle/PGL/blob/main/legacy/pgl/utils/paddle_helper.py

New version: https://github.com/PaddlePaddle/PGL/blob/main/pgl/utils/helper.py

        Some tutorial codes on the Internet are very old, which leads to many other problems, such as AttributeError: module 'pgl' has no attribute 'graph_wrapper'. And currently pip can only install packages of version 2.0.0 and above.

         So you have to compile and install from source: Release 1.2 · PaddlePaddle/PGL · GitHub

wget https://github.com/PaddlePaddle/PGL/archive/refs/tags/1.2.zip
unzip 1.2.zip
cd PGL-1.2
python setup.py install

(Occasionally there will still be strange problems)

Guess you like

Origin blog.csdn.net/sxf1061700625/article/details/130691630