You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Remove deprecated .path access in Muon optimizer for TF 2.16+ compatibility
Fixes keras.optimizers.Muon failing with AttributeError: 'ResourceVariable' object has no attribute 'path' in Keras 3 / TF 2.16-2.20.
Changes:
- Replaced deprecated .path references with _get_variable_index() for variable identification
- Updated build() to use lists instead of dicts, initialized with [None] * len(var_list)
- Updated _should_use_adamw() logic to safely check .path only during build
- Updated update_step(), _muon_update_step(), and _adamw_update_step() to use _get_variable_index()
- Added robust error handling for invalid regex patterns in exclude_layers
- Reverted image_utils.py changes as requested by reviewer
Result: All tests pass. Compatible with TensorFlow 2.16+.
Closes#21793
0 commit comments