Open lonngxiang opened 2 years ago
import paddle import paddle.nn as nn import paddle.distributed as dist import pgl
from pahelix.model_zoo.pretrain_gnns_model import PretrainGNNModel, AttrmaskModel from pahelix.datasets.zinc_dataset import load_zinc_dataset from pahelix.utils.splitters import RandomSplitter from pahelix.featurizers.pretrain_gnn_featurizer import AttrmaskTransformFn, AttrmaskCollateFn from pahelix.utils import load_json_config
Hi lonngxiang, thank you for using PaddleHelix. It seems like a problem with the python version. May I ask which version of python are you using? Also please provide the pgl version that you are using. You can run command like this to get the pgl version: import pgl
and
print(pgl.__version__)
Hi lonngxiang, thank you for using PaddleHelix. It seems like a problem with the python version. May I ask which version of python are you using? Also please provide the pgl version that you are using. You can run command like this to get the pgl version:
import pgl
andprint(pgl.__version__)
python 3.7.11; pgl 2.2.0, tks for u reply
Hi lonngxiang, I reproduced the problem that you met, and it may be caused by some changes in python conflicting with the pgl's default multiprocess settings.
A temporary fix can be done by replacing the 19 line of the mp_reader.py multiprocessing.set_start_method("fork")
with multiprocessing.set_start_method("spawn")
.
In my environment, this will solve the import issue, hope this can be helpful to you.
By the way, the mp_reader.py's location can be got from the errors reported, like this
import multiprocessing
multiprocessing.set_start_method("spawn")
tks, it works. by the way,'multiprocessing.set_start_method("spawn")' must be changed in the mp_reader.py file
Hi lonngxiang, I reproduced the problem that you met, and it may be caused by some changes in python conflicting with the pgl's default multiprocess settings. A temporary fix can be done by replacing the 19 line of the mp_reader.py
multiprocessing.set_start_method("fork")
withmultiprocessing.set_start_method("spawn")
. In my environment, this will solve the import issue, hope this can be helpful to you. By the way, the mp_reader.py's location can be got from the errors reported, like this
tks, it works. by the way,'multiprocessing.set_start_method("spawn")' must be changed in the mp_reader.py file