From dbfcee4b4a7cacfd34d7884073421427517cc71c Mon Sep 17 00:00:00 2001 From: Yupeng Hou Date: Mon, 16 Oct 2023 17:10:22 -0700 Subject: [PATCH 1/3] Update python-package.yml --- .github/workflows/python-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 641fd03..d055ce5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: python-version: [3.9] - torch-version: [1.11.0] + torch-version: [2.0] defaults: run: shell: bash -l {0} @@ -41,10 +41,10 @@ jobs: pip install recbole==1.1.1 conda list conda install -c conda-forge faiss-cpu - conda install -c conda-forge libstdcxx-ng - sudo rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6 - sudo ln -s /home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/lib/gcc/12/libstdc++.so.6.0.30 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 - pip install setuptools==59.5.0 + # conda install -c conda-forge libstdcxx-ng + # sudo rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6 + # sudo ln -s /home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/lib/gcc/12/libstdc++.so.6.0.30 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 + # pip install setuptools==59.5.0 # Use "python -m pytest" instead of "pytest" to fix imports - name: Test model run: | From cc3f0cc71b26373670e6cc995d41d4e4532b87ba Mon Sep 17 00:00:00 2001 From: Yupeng Hou Date: Mon, 16 Oct 2023 17:45:41 -0700 Subject: [PATCH 2/3] Update python-package.yml --- .github/workflows/python-package.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d055ce5..b1f3489 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: python-version: [3.9] - torch-version: [2.0] + torch-version: [2.0.0] defaults: run: shell: bash -l {0} @@ -37,10 +37,13 @@ jobs: pip install pytest pip install dgl pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html - pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html + pip install torch_geometric + pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html + # pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html pip install recbole==1.1.1 conda list conda install -c conda-forge faiss-cpu + pip install numpy==1.19 # conda install -c conda-forge libstdcxx-ng # sudo rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6 # sudo ln -s /home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/lib/gcc/12/libstdc++.so.6.0.30 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 From f18261bdca3ef1f388e8f9041f90d9bdb5b06e90 Mon Sep 17 00:00:00 2001 From: Yupeng Hou Date: Tue, 17 Oct 2023 20:57:35 -0700 Subject: [PATCH 3/3] Fix numpy compatibility following RecBole #1621 --- .github/workflows/python-package.yml | 10 +--------- recbole_gnn/config.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b1f3489..c5343ef 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,17 +37,9 @@ jobs: pip install pytest pip install dgl pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html - pip install torch_geometric - pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html - # pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html + pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html pip install recbole==1.1.1 - conda list conda install -c conda-forge faiss-cpu - pip install numpy==1.19 - # conda install -c conda-forge libstdcxx-ng - # sudo rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6 - # sudo ln -s /home/linuxbrew/.linuxbrew/Cellar/gcc/12.2.0/lib/gcc/12/libstdc++.so.6.0.30 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 - # pip install setuptools==59.5.0 # Use "python -m pytest" instead of "pytest" to fix imports - name: Test model run: | diff --git a/recbole_gnn/config.py b/recbole_gnn/config.py index 42b22e3..ff15d06 100644 --- a/recbole_gnn/config.py +++ b/recbole_gnn/config.py @@ -16,8 +16,20 @@ def __init__(self, model=None, dataset=None, config_file_list=None, config_dict= config_file_list (list of str): the external config file, it allows multiple config files, default is None. config_dict (dict): the external parameter dictionaries, default is None. """ + self.compatibility_settings() super(Config, self).__init__(model, dataset, config_file_list, config_dict) + def compatibility_settings(self): + import numpy as np + np.bool = np.bool_ + np.int = np.int_ + np.float = np.float_ + np.complex = np.complex_ + np.object = np.object_ + np.str = np.str_ + np.long = np.int_ + np.unicode = np.unicode_ + def _get_model_and_dataset(self, model, dataset): if model is None: