Repository: pykale/pykale (language: python)

Issue:
[Bug] Graph related test errors
# 🐛 Bug

Graph related test errors

## To reproduce

Rerun test at https://github.com/pykale/pykale/pull/236/checks?check_run_id=3881288474

** Stack trace/error message **
```
==================================== ERRORS ====================================
_________________ ERROR collecting tests/embed/test_gripnet.py _________________
tests/embed/test_gripnet.py:6: in <module>
    from kale.embed.gripnet import TypicalGripNetEncoder
kale/embed/gripnet.py:12: in <module>
    from kale.embed.gcn import GCNEncoderLayer, RGCNEncoderLayer
kale/embed/gcn.py:4: in <module>
    from torch_geometric.nn.conv import MessagePassing
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/__init__.py:7: in <module>
    import torch_geometric.data
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/data/__init__.py:1: in <module>
    from .data import Data
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/data/data.py:3: in <module>
    from torch_geometric.typing import OptTensor
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/typing.py:4: in <module>
    from torch_sparse import SparseTensor
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_sparse/__init__.py:16: in <module>
    f'{library}_{suffix}', [osp.dirname(__file__)]).origin)
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch/_ops.py:104: in load_library
    ctypes.CDLL(path)
/usr/share/miniconda/envs/test/lib/python3.7/ctypes/__init__.py:364: in __init__
    self._handle = _dlopen(self._name, mode)
E   OSError: /usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_sparse/_convert_cpu.so: undefined symbol: _ZNK2at6Tensor6deviceEv
_________________ ERROR collecting tests/embed/test_seq_nn.py __________________
tests/embed/test_seq_nn.py:3: in <module>
    from kale.embed.seq_nn import CNNEncoder, GCNEncoder
kale/embed/seq_nn.py:7: in <module>
    from torch_geometric.nn import GCNConv, global_max_pool
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/__init__.py:7: in <module>
    import torch_geometric.data
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/data/__init__.py:1: in <module>
    from .data import Data
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/data/data.py:3: in <module>
    from torch_geometric.typing import OptTensor
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/typing.py:4: in <module>
    from torch_sparse import SparseTensor
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_sparse/__init__.py:16: in <module>
    f'{library}_{suffix}', [osp.dirname(__file__)]).origin)
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch/_ops.py:104: in load_library
    ctypes.CDLL(path)
/usr/share/miniconda/envs/test/lib/python3.7/ctypes/__init__.py:364: in __init__
    self._handle = _dlopen(self._name, mode)
E   OSError: /usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_sparse/_convert_cpu.so: undefined symbol: _ZNK2at6Tensor6deviceEv
_______________ ERROR collecting tests/pipeline/test_deep_dti.py _______________
tests/pipeline/test_deep_dti.py:6: in <module>
    from kale.embed.seq_nn import CNNEncoder
kale/embed/seq_nn.py:7: in <module>
    from torch_geometric.nn import GCNConv, global_max_pool
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/__init__.py:7: in <module>
    import torch_geometric.data
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/data/__init__.py:1: in <module>
    from .data import Data
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/data/data.py:3: in <module>
    from torch_geometric.typing import OptTensor
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_geometric/typing.py:4: in <module>
    from torch_sparse import SparseTensor
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_sparse/__init__.py:16: in <module>
    f'{library}_{suffix}', [osp.dirname(__file__)]).origin)
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch/_ops.py:104: in load_library
    ctypes.CDLL(path)
/usr/share/miniconda/envs/test/lib/python3.7/ctypes/__init__.py:364: in __init__
    self._handle = _dlopen(self._name, mode)
E   OSError: /usr/share/miniconda/envs/test/lib/python3.7/site-packages/torch_sparse/_convert_cpu.so: undefined symbol: _ZNK2at6Tensor6deviceEv

---------- coverage: platform linux, python 3.7.11-final-0 -----------
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
kale/__init__.py                            1      0   100%
kale/embed/__init__.py                      0      0   100%
kale/embed/attention_cnn.py                40     30    25%
kale/embed/gcn.py                          98     94     4%
kale/embed/gripnet.py                      81     77     5%
kale/embed/image_cnn.py                   193    164    15%
kale/embed/mpca.py                        107     90    16%
kale/embed/positional_encoding.py          20     14    30%
kale/embed/seq_nn.py                       36     33     8%
kale/embed/video_feature_extractor.py      59     51    14%
kale/embed/video_i3d.py                   217    191    12%
kale/embed/video_res3d.py                 188    142    24%
kale/embed/video_se_i3d.py                153    139     9%
kale/embed/video_se_res3d.py              148    132    11%
kale/embed/video_selayer.py               100     78    22%
kale/evaluate/__init__.py                   0      0   100%
kale/evaluate/metrics.py                   12     12     0%
kale/interpret/__init__.py                  0      0   100%
kale/interpret/model_weights.py            15     12    20%
kale/interpret/visualize.py                42     37    12%
kale/loaddata/__init__.py                   0      0   100%
kale/loaddata/dataset_access.py            30     20    33%
kale/loaddata/image_access.py             156    100    36%
kale/loaddata/mnistm.py                    77     59    23%
kale/loaddata/multi_domain.py             288    235    18%
kale/loaddata/sampler.py                  199    167    16%
kale/loaddata/tdc_datasets.py              28     20    29%
kale/loaddata/usps.py                      63     47    25%
kale/loaddata/video_access.py              96     63    34%
kale/loaddata/video_datasets.py            59     43    27%
kale/loaddata/video_multi_domain.py       127    114    10%
kale/loaddata/videos.py                    90     66    27%
kale/pipeline/__init__.py                   0      0   100%
kale/pipeline/deep_dti.py                  60     60     0%
kale/pipeline/domain_adapter.py           520    425    18%
kale/pipeline/mpca_trainer.py              73     52    29%
kale/pipeline/multi_domain_adapter.py     170    140    18%
kale/pipeline/video_domain_adapter.py     392    360     8%
kale/predict/__init__.py                    0      0   100%
kale/predict/class_domain_nets.py         100     75    25%
kale/predict/decode.py                     20     14    30%
kale/predict/isonet.py                    204    164    20%
kale/predict/losses.py                     77     64    17%
kale/prepdata/__init__.py                   0      0   100%
kale/prepdata/chem_transform.py            31     20    35%
kale/prepdata/image_transform.py           80     59    26%
kale/prepdata/tensor_reshape.py            26     14    46%
kale/prepdata/video_transform.py           23     16    30%
kale/utils/__init__.py                      0      0   100%
kale/utils/download.py                     35     27    23%
kale/utils/logger.py                       19     13    32%
kale/utils/print.py                         9      6    33%
kale/utils/seed.py                         12      2    83%
-----------------------------------------------------------
TOTAL                                    4574   3741    18%

=========================== short test summary info ============================
ERROR tests/embed/test_gripnet.py - OSError: /usr/share/miniconda/envs/test/l...
ERROR tests/embed/test_seq_nn.py - OSError: /usr/share/miniconda/envs/test/li...
ERROR tests/pipeline/test_deep_dti.py - OSError: /usr/share/miniconda/envs/te...
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 3 errors in 3.73s ===============================
Error: Process completed with exit code 2.
```

## Expected Behaviour

Test fails

## Additional context
This is urgent because no PR can be merged without fixing this.



Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index bf96c1620..a7e729503 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 
 -----------------------------------------
 
-![tests](https://github.com/pykale/pykale/workflows/test/badge.svg)
+[![tests](https://github.com/pykale/pykale/workflows/test/badge.svg)](https://github.com/pykale/pykale/actions/workflows/test.yml)
 [![Documentation Status](https://readthedocs.org/projects/pykale/badge/?version=latest)](https://pykale.readthedocs.io/en/latest/?badge=latest)
 [![PyPI version](https://img.shields.io/pypi/v/pykale?color=blue)](https://pypi.org/project/pykale/)
 [![codecov](https://codecov.io/gh/pykale/pykale/branch/main/graph/badge.svg?token=jmIYPbA2le)](https://codecov.io/gh/pykale/pykale)


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b8597161a..cf31b212d 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -41,7 +41,7 @@ jobs:
           pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.0+cpu.html
           pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.7.0+cpu.html
           pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.7.0+cpu.html
-          pip install torch-geometric
+          pip install torch-geometric --ignore-installed certifi
           pip install -e .[dev]
         shell: bash -l {0}
       - name: Run unit tests