Skip to content

Enforce Keras safe mode when loading models in evaluate_pruning. - #1314

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1020190437
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1020190437

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Enforce Keras safe mode when loading models in evaluate_pruning.

The evaluate_pruning tool now loads models with Keras safe mode enabled
for all formats, including HDF5 and SavedModel. Python code embedded in
the model (e.g. in Lambda layers) is no longer deserialized by default.
Pass the new --allow_unsafe_deserialization flag to allow it, but only for
models from trusted sources.

@github-actions github-actions Bot added the technique:pruning Regarding tfmot.sparsity.keras APIs and docs label Nov 12, 2026
@copybara-service
copybara-service Bot force-pushed the test_1020190437 branch 5 times, most recently from a162129 to 73a39f0 Compare November 13, 2026 19:22
The evaluate_pruning tool now loads models with Keras safe mode enabled
for all formats, including HDF5 and SavedModel. Python code embedded in
the model (e.g. in Lambda layers) is no longer deserialized by default.
Pass the new --allow_unsafe_deserialization flag to allow it, but only for
models from trusted sources.

PiperOrigin-RevId: 1020190437
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technique:pruning Regarding tfmot.sparsity.keras APIs and docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant