Skip to content

Commit b758903

Browse files
Johannes Ball?copybara-github
authored andcommitted
Fix for Github issue #18.
PiperOrigin-RevId: 259013346 Change-Id: I01d3527ba73dfc47424fab562256199915c95d09
1 parent 7973d10 commit b758903

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/bls2017.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ def decompress():
248248

249249
y_shape = [int(s) for s in y_shape] + [args.num_filters]
250250

251+
# Create a no-op analysis transform so that the name scopes in the checkpoint
252+
# match.
253+
analysis_transform(
254+
tf.placeholder(tf.float32, (1, None, None, 3)), args.num_filters)
255+
251256
# Add a batch dimension, then decompress and transform the image back.
252257
strings = tf.expand_dims(string, 0)
253258
entropy_bottleneck = tfc.EntropyBottleneck(dtype=tf.float32)
@@ -257,7 +262,7 @@ def decompress():
257262

258263
# Remove batch dimension, and crop away any extraneous padding on the bottom
259264
# or right boundaries.
260-
x_hat = x_hat[0, :x_shape[0], :x_shape[1], :]
265+
x_hat = x_hat[0, :int(x_shape[0]), :int(x_shape[1]), :]
261266

262267
# Write reconstructed image out as a PNG file.
263268
op = save_image(args.output, x_hat)

0 commit comments

Comments
 (0)