• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Description:
2#   Contains the Keras Application package (internal TensorFlow version).
3
4load("//tensorflow:tensorflow.bzl", "tf_py_test")
5
6package(
7    default_visibility = ["//visibility:public"],
8    licenses = ["notice"],  # Apache 2.0
9)
10
11exports_files(["LICENSE"])
12
13py_library(
14    name = "applications",
15    srcs = [
16        "__init__.py",
17        "densenet.py",
18        "efficientnet.py",
19        "imagenet_utils.py",
20        "inception_resnet_v2.py",
21        "inception_v3.py",
22        "mobilenet.py",
23        "mobilenet_v2.py",
24        "nasnet.py",
25        "resnet.py",
26        "resnet_v2.py",
27        "vgg16.py",
28        "vgg19.py",
29        "xception.py",
30    ],
31    srcs_version = "PY2AND3",
32    visibility = ["//visibility:public"],
33    deps = [
34        "//tensorflow/python:util",
35        "//tensorflow/python/keras:backend",
36        "//tensorflow/python/keras:engine",
37        "//tensorflow/python/keras/layers",
38    ],
39)
40
41tf_py_test(
42    name = "applications_test",
43    size = "medium",
44    srcs = ["applications_test.py"],
45    shard_count = 32,
46    deps = [
47        ":applications",
48        "//tensorflow/python:client_testlib",
49        "@absl_py//absl/testing:parameterized",
50    ],
51)
52
53# Add target for each application module file, to make sure it only
54# runs the test for the application models contained in that
55# application module when it has been modified.
56# TODO(b/146940090): Remove the "no_oss" tag in the following tests.
57tf_py_test(
58    name = "applications_load_weight_test_resnet",
59    srcs = ["applications_load_weight_test.py"],
60    args = ["--module=resnet"],
61    main = "applications_load_weight_test.py",
62    tags = [
63        "no_oss",
64        "no_pip",
65    ],
66    deps = [
67        ":applications",
68        "//tensorflow/python:client_testlib",
69        "@absl_py//absl/testing:parameterized",
70    ],
71)
72
73tf_py_test(
74    name = "applications_load_weight_test_resnet_v2",
75    srcs = ["applications_load_weight_test.py"],
76    args = ["--module=resnet_v2"],
77    main = "applications_load_weight_test.py",
78    tags = [
79        "no_oss",
80        "no_pip",
81    ],
82    deps = [
83        ":applications",
84        "//tensorflow/python:client_testlib",
85        "@absl_py//absl/testing:parameterized",
86    ],
87)
88
89tf_py_test(
90    name = "applications_load_weight_test_vgg16",
91    srcs = ["applications_load_weight_test.py"],
92    args = ["--module=vgg16"],
93    main = "applications_load_weight_test.py",
94    tags = [
95        "no_oss",
96        "no_pip",
97    ],
98    deps = [
99        ":applications",
100        "//tensorflow/python:client_testlib",
101        "@absl_py//absl/testing:parameterized",
102    ],
103)
104
105tf_py_test(
106    name = "applications_load_weight_test_vgg19",
107    srcs = ["applications_load_weight_test.py"],
108    args = ["--module=vgg19"],
109    main = "applications_load_weight_test.py",
110    tags = [
111        "no_oss",
112        "no_pip",
113    ],
114    deps = [
115        ":applications",
116        "//tensorflow/python:client_testlib",
117        "@absl_py//absl/testing:parameterized",
118    ],
119)
120
121tf_py_test(
122    name = "applications_load_weight_test_xception",
123    srcs = ["applications_load_weight_test.py"],
124    args = ["--module=xception"],
125    main = "applications_load_weight_test.py",
126    tags = [
127        "no_oss",
128        "no_pip",
129    ],
130    deps = [
131        ":applications",
132        "//tensorflow/python:client_testlib",
133        "@absl_py//absl/testing:parameterized",
134    ],
135)
136
137tf_py_test(
138    name = "applications_load_weight_test_inception_v3",
139    srcs = ["applications_load_weight_test.py"],
140    args = ["--module=inception_v3"],
141    main = "applications_load_weight_test.py",
142    tags = [
143        "no_oss",
144        "no_pip",
145    ],
146    deps = [
147        ":applications",
148        "//tensorflow/python:client_testlib",
149        "@absl_py//absl/testing:parameterized",
150    ],
151)
152
153tf_py_test(
154    name = "applications_load_weight_test_inception_resnet_v2",
155    srcs = ["applications_load_weight_test.py"],
156    args = ["--module=inception_resnet_v2"],
157    main = "applications_load_weight_test.py",
158    tags = [
159        "no_oss",
160        "no_pip",
161    ],
162    deps = [
163        ":applications",
164        "//tensorflow/python:client_testlib",
165        "@absl_py//absl/testing:parameterized",
166    ],
167)
168
169tf_py_test(
170    name = "applications_load_weight_test_mobilenet",
171    srcs = ["applications_load_weight_test.py"],
172    args = ["--module=mobilenet"],
173    main = "applications_load_weight_test.py",
174    tags = [
175        "no_oss",
176        "no_pip",
177    ],
178    deps = [
179        ":applications",
180        "//tensorflow/python:client_testlib",
181        "@absl_py//absl/testing:parameterized",
182    ],
183)
184
185tf_py_test(
186    name = "applications_load_weight_test_mobilenet_v2",
187    srcs = ["applications_load_weight_test.py"],
188    args = ["--module=mobilenet_v2"],
189    main = "applications_load_weight_test.py",
190    tags = [
191        "no_oss",
192        "no_pip",
193    ],
194    deps = [
195        ":applications",
196        "//tensorflow/python:client_testlib",
197        "@absl_py//absl/testing:parameterized",
198    ],
199)
200
201tf_py_test(
202    name = "applications_load_weight_test_densenet",
203    size = "large",
204    srcs = ["applications_load_weight_test.py"],
205    args = ["--module=densenet"],
206    main = "applications_load_weight_test.py",
207    shard_count = 3,
208    tags = [
209        "no_oss",
210        "no_pip",
211    ],
212    deps = [
213        ":applications",
214        "//tensorflow/python:client_testlib",
215        "@absl_py//absl/testing:parameterized",
216    ],
217)
218
219tf_py_test(
220    name = "applications_load_weight_test_efficientnet",
221    size = "large",
222    srcs = ["applications_load_weight_test.py"],
223    args = ["--module=efficientnet"],
224    main = "applications_load_weight_test.py",
225    shard_count = 8,
226    tags = [
227        "no_oss",
228        "no_pip",
229    ],
230    deps = [
231        ":applications",
232        "//tensorflow/python:client_testlib",
233        "@absl_py//absl/testing:parameterized",
234    ],
235)
236
237tf_py_test(
238    name = "applications_load_weight_test_nasnet",
239    srcs = ["applications_load_weight_test.py"],
240    args = ["--module=nasnet"],
241    main = "applications_load_weight_test.py",
242    tags = [
243        "no_oss",
244        "no_pip",
245    ],
246    deps = [
247        ":applications",
248        "//tensorflow/python:client_testlib",
249        "@absl_py//absl/testing:parameterized",
250    ],
251)
252
253tf_py_test(
254    name = "imagenet_utils_test",
255    size = "medium",
256    srcs = ["imagenet_utils_test.py"],
257    shard_count = 2,
258    deps = [
259        ":applications",
260        "//tensorflow/python:client_testlib",
261        "@absl_py//absl/testing:parameterized",
262    ],
263)
264