Skip to content

Commit 69e6503

Browse files
author
Xinlei Chen
committed
fix zlib.
1 parent 025345f commit 69e6503

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

configure

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ while true; do
183183

184184
fromuser=""
185185
if [ -z "$CUDA_TOOLKIT_PATH" ]; then
186-
default_cuda_path=/usr/local/cuda-8.0
186+
default_cuda_path=/usr/local/cuda-7.5
187187
if is_windows; then
188188
if [ -z "$CUDA_PATH" ]; then
189189
default_cuda_path="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0"
@@ -236,7 +236,7 @@ while true; do
236236

237237
fromuser=""
238238
if [ -z "$CUDNN_INSTALL_PATH" ]; then
239-
default_cudnn_path=/home/xinleic/tools/cudnn-v5.1-2
239+
default_cudnn_path=/home/xinleic/tools/cudnn-v5.1
240240
read -p "Please specify the location where cuDNN $TF_CUDNN_VERSION library is installed. Refer to README.md for more details. [Default is $default_cudnn_path]: " CUDNN_INSTALL_PATH
241241
fromuser="1"
242242
if [ -z "$CUDNN_INSTALL_PATH" ]; then
@@ -331,14 +331,14 @@ done
331331
# Since Cuda toolkit is not backward-compatible, this is not guaranteed to work.
332332
while true; do
333333
fromuser=""
334-
default_cuda_compute_capabilities="3.5,5.2,6.1"
334+
default_cuda_compute_capabilities="3.5,5.2"
335335
if [ -z "$TF_CUDA_COMPUTE_CAPABILITIES" ]; then
336336
cat << EOF
337337
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
338338
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
339339
Please note that each additional compute capability significantly increases your build time and binary size.
340340
EOF
341-
read -p "[Default is: \"3.5,5.2,6.1\"]: " TF_CUDA_COMPUTE_CAPABILITIES
341+
read -p "[Default is: \"3.5,5.2\"]: " TF_CUDA_COMPUTE_CAPABILITIES
342342
fromuser=1
343343
fi
344344
if [ -z "$TF_CUDA_COMPUTE_CAPABILITIES" ]; then

tensorflow/python/ops/image_ops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
@@crop_to_bounding_box
8282
@@extract_glimpse
8383
84+
@@resample_and_pad
85+
@@resize_and_pad
86+
8487
@@crop_and_resize
8588
8689
## Flipping, Rotating and Transposing

tensorflow/python/ops/image_ops_impl.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,31 @@ def resample_and_pad(image, offset_height, offset_width,
366366
if len(image.get_shape()) == 3:
367367
image = array_ops.expand_dims(image, 0)
368368
batch_size, _, _, depth = _ImageDimensions(image)
369-
resized = resample(image, [height, width])
369+
resized = gen_image_ops.resample(image, [height, width])
370+
after_padding_width = target_width - offset_width - width
371+
after_padding_height = target_height - offset_height - height
372+
paddings = array_ops.reshape(
373+
array_ops.pack([0, 0,
374+
offset_height, after_padding_height,
375+
offset_width, after_padding_width,
376+
0, 0]),
377+
[4, 2])
378+
padded = array_ops.pad(resized, paddings)
379+
padded_shape = [None if _is_tensor(i) else i
380+
for i in [batch_size, target_height, target_width, depth]]
381+
padded.set_shape(padded_shape)
382+
return padded
383+
384+
385+
# Added by X
386+
def resize_and_pad(image, offset_height, offset_width,
387+
height, width,
388+
target_height, target_width):
389+
# written by X, no back propagation through roi, but anyway
390+
if len(image.get_shape()) == 3:
391+
image = array_ops.expand_dims(image, 0)
392+
batch_size, _, _, depth = _ImageDimensions(image)
393+
resized = gen_image_ops.resize_bilinear(image, [height, width])
370394
after_padding_width = target_width - offset_width - width
371395
after_padding_height = target_height - offset_height - height
372396
paddings = array_ops.reshape(

tensorflow/workspace.bzl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
238238

239239
native.new_http_archive(
240240
name = "zlib_archive",
241-
url = "http://zlib.net/zlib-1.2.8.tar.gz",
242-
sha256 = "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d",
243-
strip_prefix = "zlib-1.2.8",
241+
url = "http://zlib.net/zlib-1.2.11.tar.gz",
242+
strip_prefix = "zlib-1.2.11",
244243
build_file = str(Label("//:zlib.BUILD")),
245244
)
246245

0 commit comments

Comments
 (0)