Open
Description
Issue Description
When running the test tests/explainers/test_deep.py::test_pytorch_mnist_cnn_call
on a macOS runner one experiences a SegmentationError (see stacktrace below). Note that when running all tests (e.g. python -m pytest tests
) this results in an infinite loop till the timeout cancels the run.
EDIT: this was reported before (#3518) and is still an open issue on torch: pytorch/pytorch#121101. We solved this by pinning torch to 2.2.0
but on python 3.12 this does not seem to work anymore.
So this merely serves as a tracker for that issue.
Minimal Reproducible Example
bash-3.2$ python -m pytest tests/explainers/test_deep.py::test_pytorch_mnist_cnn_call
============================= test session starts ==============================
platform darwin -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0
Matplotlib: 3.10.1
Freetype: 2.6.1
rootdir: /Users/runner/work/shap/shap
configfile: pyproject.toml
plugins: mpl-0.17.0, cov-6.1.1
collected 4 items
tests/explainers/test_deep.py Fatal Python error: Segmentation fault
Thread 0x0000000176fff000 (most recent call first):
<no Python frame>
Thread 0x00000001ebfe0f80 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/dataclasses.py", line 473 in _create_fn
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/dataclasses.py", line 619 in _init_fn
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/dataclasses.py", line 1063 in _process_class
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/dataclasses.py", line 1265 in wrap
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/dataclasses.py", line 1275 in dataclass
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/transformers/modeling_outputs.py", line 371 in <module>
File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
bash-3.2$ python -m pytest tests/explainers/test_deep.py::test_pytorch_mnist_cnn_call
Traceback
Expected Behavior
No response
Bug report checklist
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest release of shap.
- I have confirmed this bug exists on the master branch of shap.
- I'd be interested in making a PR to fix this bug
Installed Versions
latest