glum icon indicating copy to clipboard operation
glum copied to clipboard

Python Segmentation fault: 11 on MacOS Big Sur

Open chavdar-chanev opened this issue 3 years ago • 1 comments

Environment OS: Big Sur (Version 11.6.1) Python: 3.8.6 64-bit pytest: 6.2.5

Details In a Python project, I have a class - suppose it's called glm_models.py - which fits aGeneralizedLinearRegressor based on provided model params (value of alpha, bounds, and regularisation type - either ridge or lasso). When trying to run its test class (e.g. pytest -sk test_glm_models.py), I run into a:

Fatal Python error: Segmentation fault

Thread 0x000000010bb8ce00 (most recent call first):
  File "(...)/.venv/lib/python3.8/site-packages/tabmat/dense_matrix.py", line 83 in _get_col_stds
  File "(...)/.venv/lib/python3.8/site-packages/tabmat/matrix_base.py", line 143 in standardize
  File "/Users/ccSegmentation fault: 11

I can run a given unit test in isolation (from the same folder where the test class is located) e.g. pytest -k test_glm_ridge_function. However, I am unable to run the entire collection of unit tests, because as soon as I reach the GLM test class, pytest just hangs in there.

Steps to reproduce In a Python project:

  1. Create a class for fitting GeneralizedLinearRegressor models.
  2. Create a test file with a unit test in which I am trying to instantiate and fit a GeneralizedLinearRegressor model and compare its coefficients against those produced by a sklearn.linear_model.Lasso model.
  3. Run pytest -sk test_filename.py

P.S. Upgrading to a more recent version of python did not help unfortunately.

chavdar-chanev avatar Nov 30 '21 17:11 chavdar-chanev

We need more details to investigate this issue.

  • What does the data you are trying to fit the model on look like?
  • How are you creating the GeneralizedLinearRegressor object?
  • What version of tabmat and glum are you using?

It would be ideal if you could provide a self-contained reproducible example. The steps to reproduce are not precise enough since I can follow these steps to create an example that works.

MarcAntoineSchmidtQC avatar Nov 30 '21 18:11 MarcAntoineSchmidtQC

Closed as unresponsive. Feel free to reopen!

lbittarello avatar Mar 15 '23 08:03 lbittarello