[Python] R abortes on MacMini and not on Windows

Discussão em 'Python' iniciado por Stack, Maio 31, 2025.

  1. Stack

    Stack Membro Participativo

    I want to use the Python versions of TabPFN and AutoGluon via the reticulate package in R. When I run the code on my laptop (Windows), everything works fine. However, as soon as I run the same code on my Mac Mini, the R session crashes. With AutoGluon, it usually happens during prediction, and with TabPFN, it typically occurs when the module is being loaded. (And I really want to use R—for various reasons.)

    Maybe someone has experienced similar issues when using macOS vs. Windows and can help me out.

    This is the used code:

    library(mlr3)
    library(mlr3tuning)
    library(reticulate)

    # tabpfn
    tabpfn = import('tabpfn')

    set.seed(42)
    n = 30
    p = 5
    X = matrix(rnorm(n * p), ncol = p)
    y = sample(0:1, n, replace = TRUE)


    py_X = r_to_py(X)
    py_y = r_to_py(y)

    tabpfn_model = tabpfn$TabPFNClassifier(device = 'cpu')
    tabpfn_model$fit(py_X, py_y)

    predictions = tabpfn_model$predict(py_X)
    r_predictions = py_to_r(predictions)
    print(r_predictions)

    # autogloun
    autogluon = import('autogluon.tabular')

    train_data = cbind(X, target = y)
    py_train_data = r_to_py(train_data)

    predictor = autogluon$TabularPredictor(label = 'target')
    predictor$fit(
    train_data = py_train_data,
    presets = 'best_quality',
    time_limit = 30
    )

    predictions = predictor$predict(py_train_data)
    r_predictions = py_to_r(predictions)
    print(r_predictions)


    Additional some system information:

    py_config()
    python: /Users/Dummy/.virtualenvs/r-reticulate/bin/python
    libpython: /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/config-3.12-darwin/libpython3.12.dylib
    pythonhome: /Users/Dummy/.virtualenvs/r-reticulate:/Users/Dummy/.virtualenvs/r-reticulate
    version: 3.12.0 (v3.12.0:0fb18b02c8, Oct 2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)]
    numpy: /Users/Dummy/.virtualenvs/r-reticulate/lib/python3.12/site-packages/numpy
    numpy_version: 2.1.3


    Thank you very much :)

    Continue reading...

Compartilhe esta Página