Troubleshooting

This section covers migration guides, common issues, and solutions.

Overview

This section helps you resolve common issues and migrate from older versions of NIRS4ALL.

🔄 Migration Guide

Complete guide to upgrading from older NIRS4ALL versions, including API changes, dataset configuration updates, and prediction format migration.

Migration Guide
🔧 Dataset Issues

Common data loading problems and solutions.

Dataset Configuration Troubleshooting Guide
❓ FAQ

Frequently asked questions and solutions.

Frequently Asked Questions

Quick Fixes

ImportError: No module named ‘nirs4all’

pip install nirs4all
# or for development
pip install -e .

TensorFlow/PyTorch not found

Install the optional dependency:

pip install nirs4all[tensorflow]  # or [torch], [jax]

Out of Memory

# Reduce batch size in deep learning models
pipeline = [
    {"model": decon(batch_size=16)}  # Smaller batch
]

# Or reduce cross-validation folds
from sklearn.model_selection import KFold
pipeline = [
    KFold(n_splits=3),  # Instead of 10
    {"model": ...}
]

NaN in Predictions

Common causes:

  1. Missing values in data - Use imputation or filtering

  2. Incompatible preprocessing - Check spectral range

  3. Numerical instability - Add MinMaxScaler() before model

See Also