From baa501b26257c4d4fbf92b439a3f0c1440597187 Mon Sep 17 00:00:00 2001 From: fkm3 Date: Tue, 15 May 2018 23:19:15 -0400 Subject: [PATCH] Use newer version of stack in CI (#189) Required by #187. The version we were using is old enough that it doesn't work with the latest stackage LTS. haskellstack.org says There is also a Ubuntu package for Ubuntu 16.10 and up, but the distribution's Stack version lags behind, ... So, instead of asking them to update it, it's probably better to download the tar of the version we want. Somehow updating stack surfaced a new pedantic warning in GradientTest, so I've fixed that as well. --- ci_build/Dockerfile | 8 ++++++-- docker/Dockerfile | 2 +- tensorflow-ops/tests/GradientTest.hs | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ci_build/Dockerfile b/ci_build/Dockerfile index ebde853..0530c0c 100644 --- a/ci_build/Dockerfile +++ b/ci_build/Dockerfile @@ -13,7 +13,6 @@ WORKDIR /tfhs RUN \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 575159689BEFB442 && \ - echo 'deb http://download.fpcomplete.com/ubuntu trusty main'| tee /etc/apt/sources.list.d/fpco.list && \ apt-get update && \ apt-get install -y \ # Required by snappy-frames dependency. @@ -23,7 +22,12 @@ RUN \ # Makes stack viable in the container libgmp-dev \ libcurl3-dev \ - stack && \ + # Required for tcp connections by stack (See: https://github.com/tensorflow/haskell/issues/182) + netbase \ + && \ + # Installs stack. + curl -O -L https://github.com/commercialhaskell/stack/releases/download/v1.7.1/stack-1.7.1-linux-x86_64.tar.gz && \ + tar zxf stack-1.7.1-linux-x86_64.tar.gz -C /usr/local/bin stack-1.7.1-linux-x86_64/stack --strip 1 && \ # Installs protoc and the libraries. curl -O -L https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip && \ unzip -d /usr/local protoc-3.2.0-linux-x86_64.zip bin/protoc && \ diff --git a/docker/Dockerfile b/docker/Dockerfile index ac834a5..73ca904 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get install -y \ libgmp-dev \ # Required for locales configuration. locales \ - # Required for tcp connections (See: https://github.com/tensorflow/haskell/issues/182) + # Required for tcp connections by stack (See: https://github.com/tensorflow/haskell/issues/182) netbase # Our MNIST demo program outputs Unicode characters. diff --git a/tensorflow-ops/tests/GradientTest.hs b/tensorflow-ops/tests/GradientTest.hs index 04391f7..4a2c75b 100644 --- a/tensorflow-ops/tests/GradientTest.hs +++ b/tensorflow-ops/tests/GradientTest.hs @@ -397,13 +397,13 @@ testConv2DBackpropInputGrad = testCase "testConv2DBackpropInputGrad" $ do x <- TF.render $ TF.fill conv_out_shape (TF.scalar (1::Float)) let filterShape = TF.vector [2, 2, 1, 1 :: Int32] -- [fh, fw, inc, out] - filter <- TF.render $ TF.fill filterShape (TF.scalar (1::Float)) + filter' <- TF.render $ TF.fill filterShape (TF.scalar (1::Float)) let y = TF.conv2DBackpropInput' ( (TF.opAttr "strides" .~ [1::Int64, 1, 1, 1]) . (TF.opAttr "padding" .~ (BS.pack "VALID")) . (TF.opAttr "data_format" .~ (BS.pack "NHWC")) ) - conv_input_shape filter x + conv_input_shape filter' x [dx] <- TF.gradients y [x] TF.run (dx, TF.shape dx, TF.shape x)