Prompt
When documenting AI framework migrations (like TensorFlow/Keras version changes), provide complete instructions covering both installation and code modifications. Include:
- Specific package installation commands with version constraints
- Required import statement changes with before/after examples
- Environment variable configurations if applicable
- Edge cases and compatibility considerations
Example for Keras 2 to 3 migration:
# Installation
# pip install tf-keras~=2.16
# Import changes - Before:
import tensorflow.keras as keras
# or
import keras
# Import changes - After:
import tf_keras as keras
# OR to continue using Keras 2
import os
os.environ["TF_USE_LEGACY_KERAS"] = "1"
# then use original imports
This practice ensures AI developers can smoothly transition between framework versions without disrupting their workflows or introducing subtle bugs.