Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ Keras pruning API:

# TensorFlow Model Optimization next release TBD

# TensorFlow Model Optimization 0.8.1

TFMOT 0.8.1 improves compatibility with numpy v2 and dependencies.
* Fix keras importing failures at the colab.
* Add required packages to setup.py to match requirements.txt.
* Relax absl-py requirements for tensorflow_model_optimization.
* Mark compatibility with numpy v2.

# TensorFlow Model Optimization 0.8.0

TFMOT 0.8.0 forces users to use the keras v2 version.
Expand Down
2 changes: 1 addition & 1 deletion pip_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mkdir -p "$1"
DEST=$(dirname "${1}/does_not_exist")
DEST=$(cd "$DEST" && pwd)

cd bazel-bin/pip_pkg.runfiles/_main
cd bazel-bin/pip_pkg.runfiles/tensorflow_model_optimization

# Pass through remaining arguments (following the first argument, which
# specifies the output dir) to setup.py, e.g.,
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
absl-py>=1.2.0
numpy~=1.23.0
absl-py~=1.2
numpy>=1.23
six~=1.14
scipy
enum34~=1.1
mock
enum34~=1.1;python_version<"3.4"
dm-tree~=0.1.1
mock
tf-keras>=2.14.1
13 changes: 8 additions & 5 deletions tensorflow_model_optimization/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Placeholder: load py_library
load("@rules_license//rules:license.bzl", "license")

# Description:
#
# TensorFlow Optimization is a repository for the training-time
Expand All @@ -7,15 +10,15 @@
# https://github.com/tensorflow/model-optimization
load("//tensorflow_model_optimization:tensorflow_model_optimization.bzl", "py_strict_binary")

# Placeholder: load py_library
load("//tools/build_defs/license:license.bzl", "license")

package(
default_applicable_licenses = [":license"],
default_visibility = ["//visibility:public"],
)

license(name = "license")
license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"],
)

licenses(["notice"])

Expand All @@ -24,7 +27,7 @@ exports_files(["LICENSE"])
py_library(
name = "tensorflow_model_optimization",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# distutils dep1,
"//tensorflow_model_optimization/python", # buildcleaner: keep
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_model_optimization/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ licenses(["notice"])
py_library(
name = "python",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
deps = [
"//tensorflow_model_optimization/python/core", # buildcleaner: keep
],
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_model_optimization/python/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ licenses(["notice"])
py_library(
name = "core",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
deps = [
"//tensorflow_model_optimization/python/core/api", # buildcleaner: keep
"//tensorflow_model_optimization/python/core/clustering", # buildcleaner: keep
Expand All @@ -21,5 +21,5 @@ py_library(
py_library(
name = "version",
srcs = ["version.py"],
strict_deps = True,
# strict_deps = True,
)
2 changes: 1 addition & 1 deletion tensorflow_model_optimization/python/core/api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ py_library(
"sparsity/__init__.py",
"sparsity/keras/__init__.py",
],
strict_deps = True,
# strict_deps = True,
deps = [
"//tensorflow_model_optimization/python/core/clustering/keras:cluster",
"//tensorflow_model_optimization/python/core/clustering/keras:cluster_config",
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_model_optimization/python/core/clustering/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ licenses(["notice"])
py_library(
name = "clustering",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
deps = [
"//tensorflow_model_optimization/python/core/clustering/keras", # buildcleaner: keep
],
Expand Down
22 changes: 11 additions & 11 deletions tensorflow_model_optimization/python/core/clustering/keras/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ py_library(
srcs = [
"__init__.py",
],
strict_deps = True,
# strict_deps = True,
deps = [
":cluster", # buildcleaner: keep
":clustering_callbacks", # buildcleaner: keep
Expand All @@ -24,7 +24,7 @@ py_library(
py_library(
name = "cluster",
srcs = ["cluster.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":cluster_config",
Expand All @@ -38,14 +38,14 @@ py_library(
py_library(
name = "cluster_config",
srcs = ["cluster_config.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
)

py_library(
name = "clustering_registry",
srcs = ["clustering_registry.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":clusterable_layer",
Expand All @@ -58,7 +58,7 @@ py_library(
py_library(
name = "clusterable_layer",
srcs = ["clusterable_layer.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
# six dep1,
Expand All @@ -68,7 +68,7 @@ py_library(
py_library(
name = "clustering_centroids",
srcs = ["clustering_centroids.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":cluster_config",
Expand All @@ -82,7 +82,7 @@ py_library(
py_library(
name = "cluster_wrapper",
srcs = ["cluster_wrapper.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":cluster_config",
Expand All @@ -97,7 +97,7 @@ py_library(
py_library(
name = "clustering_algorithm",
srcs = ["clustering_algorithm.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
# six dep1,
Expand All @@ -109,7 +109,7 @@ py_library(
py_library(
name = "clustering_callbacks",
srcs = ["clustering_callbacks.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
# tensorflow dep1,
Expand All @@ -121,7 +121,7 @@ py_test(
name = "cluster_test",
size = "medium",
srcs = ["cluster_test.py"],
strict_deps = False,
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [
":cluster",
Expand Down Expand Up @@ -190,7 +190,7 @@ py_test(
name = "cluster_integration_test",
size = "medium",
srcs = ["cluster_integration_test.py"],
strict_deps = False,
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [
":cluster",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ py_library(
srcs = [
"__init__.py",
],
strict_deps = True,
# strict_deps = True,
deps = [
":cluster", # buildcleaner: keep
],
Expand All @@ -20,7 +20,7 @@ py_library(
py_library(
name = "cluster",
srcs = ["cluster.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
"//tensorflow_model_optimization/python/core/clustering/keras:cluster",
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_model_optimization/python/core/internal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ licenses(["notice"])
py_library(
name = "internal",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
deps = [
"//tensorflow_model_optimization/python/core/internal/tensor_encoding",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ licenses(["notice"])
py_library(
name = "tensor_encoding",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
deps = [
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/core",
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/encoders",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ licenses(["notice"])
py_library(
name = "core",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":core_encoder",
Expand All @@ -23,7 +23,7 @@ py_library(
py_library(
name = "core_encoder",
srcs = ["core_encoder.py"],
strict_deps = True,
# strict_deps = True,
deps = [
":encoding_stage",
# six dep1,
Expand All @@ -49,7 +49,7 @@ py_strict_test(
py_library(
name = "encoding_stage",
srcs = ["encoding_stage.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# six dep1,
# tensorflow dep1,
Expand All @@ -74,7 +74,7 @@ py_strict_test(
py_library(
name = "gather_encoder",
srcs = ["gather_encoder.py"],
strict_deps = True,
# strict_deps = True,
deps = [
":core_encoder",
# tensorflow dep1,
Expand Down Expand Up @@ -102,7 +102,7 @@ py_strict_test(
py_library(
name = "simple_encoder",
srcs = ["simple_encoder.py"],
strict_deps = True,
# strict_deps = True,
deps = [
":core_encoder",
# tensorflow dep1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ licenses(["notice"])
py_library(
name = "encoders",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":common_encoders",
Expand All @@ -20,7 +20,7 @@ py_library(
py_library(
name = "common_encoders",
srcs = ["common_encoders.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# tensorflow dep1,
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/core:core_encoder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ licenses(["notice"])
py_library(
name = "stages",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":stages_impl",
Expand All @@ -21,7 +21,7 @@ py_library(
py_library(
name = "stages_impl",
srcs = ["stages_impl.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# numpy dep1,
# tensorflow dep1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ licenses(["notice"])
py_library(
name = "research",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":clipping",
Expand All @@ -23,7 +23,7 @@ py_library(
py_library(
name = "clipping",
srcs = ["clipping.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# tensorflow dep1,
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/core:encoding_stage",
Expand All @@ -47,7 +47,7 @@ py_strict_test(
py_library(
name = "kashin",
srcs = ["kashin.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# numpy dep1,
# tensorflow dep1,
Expand All @@ -73,7 +73,7 @@ py_strict_test(
py_library(
name = "quantization",
srcs = ["quantization.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# tensorflow dep1,
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/core:encoding_stage",
Expand All @@ -98,7 +98,7 @@ py_strict_test(
py_library(
name = "misc",
srcs = ["misc.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# tensorflow dep1,
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/core:encoding_stage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ licenses(["notice"])
py_library(
name = "testing",
srcs = ["__init__.py"],
strict_deps = True,
# strict_deps = True,
visibility = ["//visibility:public"],
deps = [
":test_utils",
Expand All @@ -20,7 +20,7 @@ py_library(
py_library(
name = "test_utils",
srcs = ["test_utils.py"],
strict_deps = True,
# strict_deps = True,
deps = [
# absl/testing:parameterized dep1,
# numpy dep1,
Expand Down
Loading
Loading