{"id":10190,"library":"recbole","title":"RecBole","description":"RecBole is a unified, comprehensive, and efficient Python library for recommendation systems, built on PyTorch. It provides a wide array of state-of-the-art recommendation models and datasets, featuring standardized data processing, training, and evaluation pipelines. The library undergoes active development, with major updates and new versions typically released every few months, incorporating user feedback and architectural improvements.","status":"active","version":"1.2.1","language":"en","source_language":"en","source_url":"https://github.com/RUCAIBox/RecBole","tags":["recommendation-system","deep-learning","pytorch","machine-learning","recommender-systems","research"],"install":[{"cmd":"pip install recbole","lang":"bash","label":"Basic installation (CPU)"},{"cmd":"pip install recbole[gpu]","lang":"bash","label":"Installation with GPU support (requires CUDA setup)"}],"dependencies":[{"reason":"RecBole is built on PyTorch for deep learning models. Specific versions (>=1.7.0) are required.","package":"torch","optional":true}],"imports":[{"symbol":"run_recbole","correct":"from recbole.quick_start import run_recbole"},{"note":"While AbstractRecommender is a base class, most users will start with `run_recbole` or `Config` to define their model/dataset.","wrong":"from recbole.model.abstract_recommender import AbstractRecommender","symbol":"Config","correct":"from recbole.config import Config"}],"quickstart":{"code":"import os\nimport torch\nfrom recbole.quick_start import run_recbole\n\n# Ensure you have a 'dataset' folder in the current directory\n# and 'ml-100k' dataset downloaded/prepared, or RecBole will download it.\n\n# Basic configuration for running a BPR model on ml-100k dataset\n# Using CPU by default, or GPU if available and recbole[gpu] was installed.\nconfig_dict = {\n    'model': 'BPR',\n    'dataset': 'ml-100k',\n    'eval_args': {\n        'split_ratio': '0.8:0.1:0.1', # Train:Valid:Test split\n        'group_by': 'user' # Ensure evaluation is fair per user\n    },\n    'use_gpu': torch.cuda.is_available() # Dynamically check for GPU\n}\n\nprint(f\"Running RecBole with config: {config_dict}\")\n\n# Run the recommendation experiment\nrun_recbole(config_dict=config_dict)\n","lang":"python","description":"This quickstart demonstrates how to run a basic BPR recommendation model on the `ml-100k` dataset using `run_recbole`. RecBole will automatically download and preprocess the dataset if not found. The configuration dictionary allows for inline specification of model, dataset, and evaluation parameters without needing a separate YAML file."},"warnings":[{"fix":"Review the official documentation for the specific version you are upgrading to. Pay close attention to changes in data loading, dataset preparation (e.g., `create_dataset`), and how configuration objects (`Config`) are initialized and passed.","message":"Major architectural overhauls in versions like v1.0.0, v1.1.0, and v1.2.0 introduced significant changes to the framework, especially affecting the data module and configuration API.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"For GPU usage, ensure your system has a compatible CUDA toolkit installed. Then, use `pip install recbole[gpu]` or `pip install recbole torch==X.Y.Z+cuXXX` where `X.Y.Z` and `cuXXX` match your CUDA version and desired PyTorch build. Always check the official PyTorch installation guide for the correct command.","message":"RecBole often requires specific versions of PyTorch. Installing `recbole[gpu]` ensures GPU dependencies are pulled, but manual CUDA setup and matching PyTorch-CUDA versions are critical.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure your dataset files are correctly placed in the `dataset` directory (e.g., `dataset/ml-100k/ml-100k.inter`). For custom datasets, carefully follow the data format specification in the RecBole documentation. Use `config['data_path']` if your dataset is not in the default location.","message":"Configuring datasets and data preprocessing can be complex. Incorrect paths, invalid split ratios, or missing necessary dataset files (like `.inter`, `.item`, `.user` files) are common sources of errors.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Install PyTorch: `pip install torch` for CPU, or follow the PyTorch official website for GPU-compatible installation commands (`pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118` for CUDA 11.8 as an example).","cause":"PyTorch is not installed or not correctly linked. RecBole depends heavily on PyTorch.","error":"ModuleNotFoundError: No module named 'torch'"},{"fix":"Either ensure the dataset files (e.g., `ml-100k.inter`, `ml-100k.item`) are in `dataset/ml-100k/`, or specify `config['data_path'] = '/path/to/your/dataset'` in your configuration.","cause":"The specified dataset or its interaction file is not found in the expected location. RecBole looks for datasets in a 'dataset' folder by default.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'dataset/your_dataset_name/your_dataset_name.inter'"},{"fix":"Check GPU memory usage, reduce batch size. Ensure PyTorch and your CUDA driver are compatible. Reinstall `recbole[gpu]` and PyTorch, making sure to use the correct `pip` command for your CUDA version.","cause":"This typically indicates an issue with GPU memory, invalid input to a CUDA kernel, or an incorrect PyTorch-CUDA installation mismatch.","error":"RuntimeError: CUDA error: device-side assert triggered"}]}