mlflow.exceptions.MlflowException Changing param values is not allowed. Param with key'input_rows' was already logged with value'32205'
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
An `MlflowException` occurs when there is a violation of MLflow usage rules or an unintended issue during the execution of MLflow-related code. One common exception is `mlflow.exceptions.MlflowException: Changing param values is not allowed. Param with key='input_rows' was already logged with value='32205'.` This exception typically arises when there's an attempt to log a parameter with a key that has already been logged, but with a different value.
Understanding MLflow `Parameters`
What are `Parameters` in MLflow?
In MLflow, parameters are key-value pairs that are used to record inputs to a run. They are mainly used to capture metadata about machine learning experiments, enabling users to track the conditions under which a model was trained. Examples of parameters include hyperparameter values, dataset identifiers, and other relevant configuration settings.
Why is Changing Parameter Values Restricted?
MLflow enforces immutability on parameters to ensure consistency and reproducibility. Once a parameter is logged for a particular run, its value is fixed. This restriction helps maintain a complete and faithful history of experiments, allowing for:
- Reproducibility: Ensures that repeated experiments yield the same results.
- Consistency: Avoids confusion and errors that might arise from changing experiment conditions after logging.
- Integrity: Protects the accuracy and reliability of logged data.
Example Scenario
Consider the following Python script using MLflow:

