snap-stanford / relbench

RelBench: Relational Deep Learning Benchmark
https://relbench.stanford.edu
MIT License
199 stars 35 forks source link

TypeError in `rel-stack` #255

Closed Kh4L closed 2 months ago

Kh4L commented 2 months ago
python gnn_node.py --dataset=rel-stack --task=user-engagement --epochs 20

fails in np.quantile:

Traceback (most recent call last):
  File "/workspace/relbench/examples/gnn_node.py", line 70, in <module>
    data, col_stats_dict = make_pkey_fkey_graph(
  File "/usr/local/lib/python3.10/dist-packages/relbench/modeling/graph.py", line 71, in make_pkey_fkey_graph
    dataset = Dataset(
  File "/usr/local/lib/python3.10/dist-packages/torch_frame/data/dataset.py", line 594, in materialize
    self._col_stats[col] = compute_col_stats(
  File "/usr/local/lib/python3.10/dist-packages/torch_frame/data/stats.py", line 179, in compute_col_stats
    stats = {
  File "/usr/local/lib/python3.10/dist-packages/torch_frame/data/stats.py", line 180, in <dictcomp>
    stat_type: stat_type.compute(ser.dropna(), sep)
  File "/usr/local/lib/python3.10/dist-packages/torch_frame/data/stats.py", line 107, in compute
    return np.quantile(
  File "<__array_function__ internals>", line 200, in quantile
  File "/usr/local/lib/python3.10/dist-packages/numpy/lib/function_base.py", line 4461, in quantile
    return _quantile_unchecked(
  File "/usr/local/lib/python3.10/dist-packages/numpy/lib/function_base.py", line 4473, in _quantile_unchecked
    return _ureduce(a,
  File "/usr/local/lib/python3.10/dist-packages/numpy/lib/function_base.py", line 3752, in _ureduce
    r = func(a, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/numpy/lib/function_base.py", line 4639, in _quantile_ureduce_func
    result = _quantile(arr,
  File "/usr/local/lib/python3.10/dist-packages/numpy/lib/function_base.py", line 4756, in _quantile
    result = _lerp(previous,
  File "/usr/local/lib/python3.10/dist-packages/numpy/lib/function_base.py", line 4573, in _lerp
    diff_b_a = subtract(b, a)
TypeError: numpy boolean subtract, the `-` operator, is not supported, use the bitwise_xor, the `^` operator, or the logical_xor function instead.

numpy Version: 1.24.4

XinweiHe commented 2 months ago

Feels like this should be fixed by https://github.com/pyg-team/pytorch-frame/pull/421? We probably need to update the torch frame version for this to work. cc. @yiweny

Kh4L commented 2 months ago

@XinweiHe thanks, let me try with an updated pytorch-frame

Kh4L commented 2 months ago

@XinweiHe no luck with upgrading pytorch-frame to latest master https://github.com/pyg-team/pytorch-frame/commit/8d416c6d2521467761d7ccea9f100089533b5ffc tried updating numpy to 1.26 no luck neither

will cross-post to pytorch-frame

yiweny commented 2 months ago

@Kh4L Did you clear cache? rm -rf ~/.cache/relbench_examples I cannot reproduce using the latest version of pytorch-frame

Kh4L commented 2 months ago

@yiweny cache was not cleared, tried again and latest version of pytorch-frame resolves this issue

TJKlein commented 2 weeks ago

I have the same problem. Cache is cleaned (empty), latest version of pytorch-frame is installed (0.2.3).

Running rel-f1 works well:

python gnn_node.py --dataset rel-f1 --task driver-position

but running rel-stack fails:

python gnn_node.py --dataset rel-stack --task=user-engagement --epochs