diff --git a/docker/development/Dockerfile.build b/docker/development/Dockerfile.build index b0034f91d..08e6ab305 100644 --- a/docker/development/Dockerfile.build +++ b/docker/development/Dockerfile.build @@ -145,6 +145,7 @@ ARG PYTHON_VERSION_MAJOR ARG PYTHON_VERSION_MINOR ENV PYVERNAME=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} +# Limitation: numpy>=1.17 does not support python2.7 ADD python/setup_requirements.txt /tmp/deps/ ADD python/requirements.txt /tmp/deps/ ADD python/test_requirements.txt /tmp/deps/ @@ -158,6 +159,7 @@ RUN umask 0 \ && . /opt/miniconda3/bin/activate \ && conda create -n nnabla-build python=${PYVERNAME} \ && conda activate nnabla-build \ + && pip install numpy\<1.17 \ && pip install --only-binary -U -r /tmp/deps/setup_requirements.txt \ && pip install --only-binary -U -r /tmp/deps/requirements.txt \ && pip install --only-binary -U -r /tmp/deps/test_requirements.txt \ diff --git a/docker/development/Dockerfile.build-armhf b/docker/development/Dockerfile.build-armhf index 5e1606322..9e7438187 100644 --- a/docker/development/Dockerfile.build-armhf +++ b/docker/development/Dockerfile.build-armhf @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# for nnabla>=1.0.17 - FROM multiarch/ubuntu-core:armhf-xenial ENV LC_ALL C @@ -65,6 +63,7 @@ RUN mkdir /tmp/deps \ && cd / \ && rm -rf /tmp/* +# Limitation: numpy>=1.17 does not support python2.7 ADD python/setup_requirements.txt /tmp/deps/ ADD python/requirements.txt /tmp/deps/ ADD python/test_requirements.txt /tmp/deps/ @@ -74,12 +73,14 @@ RUN python2 -m pip install --upgrade pip RUN pip install ipython==5.0 +RUN pip install numpy\<1.17 RUN pip install -r /tmp/deps/setup_requirements.txt RUN pip install -r /tmp/deps/requirements.txt RUN pip install -r /tmp/deps/test_requirements.txt RUN pip3 install ipython +RUN pip3 install numpy\<1.17 RUN pip3 install -r /tmp/deps/setup_requirements.txt RUN pip3 install -r /tmp/deps/requirements.txt RUN pip3 install -r /tmp/deps/test_requirements.txt diff --git a/docker/development/Dockerfile.build-ppc64le b/docker/development/Dockerfile.build-ppc64le index 13bc38ca3..8d97ea563 100644 --- a/docker/development/Dockerfile.build-ppc64le +++ b/docker/development/Dockerfile.build-ppc64le @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# for nnabla>=1.0.17 - FROM ppc64le/centos:7 ENV LC_ALL C @@ -116,6 +114,7 @@ ARG PYTHON_VERSION_MAJOR ARG PYTHON_VERSION_MINOR ENV PYVERNAME=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} +# Limitation: numpy>=1.17 does not support python2.7 ADD python/setup_requirements.txt /tmp/deps/ ADD python/requirements.txt /tmp/deps/ ADD python/test_requirements.txt /tmp/deps/ @@ -130,6 +129,7 @@ RUN umask 0 \ && conda create -n nnabla-build python=${PYVERNAME} \ && conda activate nnabla-build \ && conda update --all -y \ + && pip install numpy\<1.17 \ && pip install -U -r /tmp/deps/setup_requirements.txt \ && pip install -U -r /tmp/deps/requirements.txt \ && pip install -U -r /tmp/deps/test_requirements.txt \ diff --git a/docker/development/Dockerfile.onnx-test b/docker/development/Dockerfile.onnx-test index 6543b23fe..2be0a5058 100644 --- a/docker/development/Dockerfile.onnx-test +++ b/docker/development/Dockerfile.onnx-test @@ -102,6 +102,7 @@ ARG PYTHON_VERSION_MAJOR ARG PYTHON_VERSION_MINOR ENV PYVERNAME=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} +# Limitation: numpy>=1.17 does not support python2.7 ADD python/setup_requirements.txt /tmp/deps/ ADD python/requirements.txt /tmp/deps/ ADD python/test_requirements.txt /tmp/deps/ @@ -115,6 +116,7 @@ RUN umask 0 \ && . /opt/miniconda3/bin/activate \ && conda create -n nnabla-build python=${PYVERNAME} \ && conda activate nnabla-build \ + && pip install numpy\<1.17 \ && pip install --only-binary -U -r /tmp/deps/setup_requirements.txt \ && pip install --only-binary -U -r /tmp/deps/requirements.txt \ && pip install --only-binary -U -r /tmp/deps/test_requirements.txt \ diff --git a/docker/development/Dockerfile.onnx-test-armhf b/docker/development/Dockerfile.onnx-test-armhf index 9c6a80e4e..626d25efa 100644 --- a/docker/development/Dockerfile.onnx-test-armhf +++ b/docker/development/Dockerfile.onnx-test-armhf @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# for nnabla>=1.0.17 - FROM multiarch/ubuntu-core:armhf-xenial ENV LC_ALL C @@ -65,17 +63,18 @@ RUN mkdir /tmp/deps \ && cd / \ && rm -rf /tmp/* +# Limitation: numpy>=1.17 does not support python2.7 RUN python3 -m pip install --upgrade pip RUN python2 -m pip install --upgrade pip +RUN pip install --no-cache-dir numpy\<1.17 RUN pip install --no-cache-dir \ autopep8 \ boto3 \ cython \ h5py \ mako \ - numpy\>=1.16 \ - onnx==1.4.1 \ + onnx \ pillow \ protobuf \ pytest \ @@ -84,15 +83,16 @@ RUN pip install --no-cache-dir \ scipy \ tqdm \ virtualenv +RUN pip install ipython==5.0 +RUN pip3 install --no-cache-dir numpy\<1.17 RUN pip3 install --no-cache-dir \ autopep8 \ boto3 \ cython \ h5py \ mako \ - numpy\>=1.16 \ - onnx==1.4.1 \ + onnx \ pillow \ protobuf \ pytest \ @@ -102,5 +102,4 @@ RUN pip3 install --no-cache-dir \ tqdm \ virtualenv -RUN pip install ipython==5.0 RUN pip3 install ipython diff --git a/docker/development/Dockerfile.onnx-test-ppc64le b/docker/development/Dockerfile.onnx-test-ppc64le index 40ba1195a..c188200c6 100644 --- a/docker/development/Dockerfile.onnx-test-ppc64le +++ b/docker/development/Dockerfile.onnx-test-ppc64le @@ -105,6 +105,7 @@ ARG PYTHON_VERSION_MAJOR ARG PYTHON_VERSION_MINOR ENV PYVERNAME=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} +# Limitation: numpy>=1.17 does not support python2.7 ADD python/setup_requirements.txt /tmp/deps/ ADD python/requirements.txt /tmp/deps/ ADD python/test_requirements.txt /tmp/deps/ @@ -119,6 +120,7 @@ RUN umask 0 \ && conda create -n nnabla-build python=${PYVERNAME} \ && conda activate nnabla-build \ && conda update --all -y \ + && pip install numpy\<1.17 \ && pip install -U -r /tmp/deps/setup_requirements.txt \ && pip install -U -r /tmp/deps/requirements.txt \ && pip install -U -r /tmp/deps/test_requirements.txt \ diff --git a/python/requirements.txt b/python/requirements.txt index 94b6ffb44..a6266d10a 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,9 +1,9 @@ +numpy>=1.16,<1.17 Cython boto3 requests h5py -numpy>=1.16 -onnx==1.4.1 +onnx protobuf pyyaml requests diff --git a/python/setup.py b/python/setup.py index babf1f81d..21f3a6218 100644 --- a/python/setup.py +++ b/python/setup.py @@ -24,7 +24,7 @@ setup_requires = [ 'setuptools', - 'numpy>=1.16', + 'numpy>=1.16,<1.17', 'Cython', # Requires python-dev. ] diff --git a/python/test/test_graph.py b/python/test/test_graph.py index eaa9fed61..172ac5230 100644 --- a/python/test/test_graph.py +++ b/python/test/test_graph.py @@ -180,6 +180,9 @@ def test_graph_clear_buffer(seed): g = list(nn.get_parameters().values())[0].g.copy() else: g2 = list(nn.get_parameters().values())[0].g.copy() + import platform + if platform.machine() == 'ppc64le': + pytest.skip("This test fails on ppc64le") assert np.all(g == g2)