diff --git a/pkgs/development/python-modules/edward/default.nix b/pkgs/development/python-modules/edward/default.nix index ac2d5023cc97..05171c22d18e 100644 --- a/pkgs/development/python-modules/edward/default.nix +++ b/pkgs/development/python-modules/edward/default.nix @@ -1,5 +1,5 @@ { lib, buildPythonPackage, fetchPypi, isPy27, pythonAtLeast -, Keras, numpy, scipy, six, tensorflow }: +, keras, numpy, scipy, six, tensorflow }: buildPythonPackage rec { pname = "edward"; @@ -15,7 +15,7 @@ buildPythonPackage rec { # disabled for now due to Tensorflow trying to create files in $HOME: doCheck = false; - propagatedBuildInputs = [ Keras numpy scipy six tensorflow ]; + propagatedBuildInputs = [ keras numpy scipy six tensorflow ]; meta = with lib; { description = "Probabilistic programming language using Tensorflow"; diff --git a/pkgs/development/python-modules/einops/default.nix b/pkgs/development/python-modules/einops/default.nix index 34510762abf7..a2de3a70971d 100644 --- a/pkgs/development/python-modules/einops/default.nix +++ b/pkgs/development/python-modules/einops/default.nix @@ -10,6 +10,7 @@ , pytorch , mxnet , tensorflow +, keras }: buildPythonPackage rec { @@ -35,6 +36,7 @@ buildPythonPackage rec { pytorch mxnet tensorflow + keras ]; # No CUDA in sandbox diff --git a/pkgs/development/python-modules/keras-preprocessing/default.nix b/pkgs/development/python-modules/keras-preprocessing/default.nix index d62a179136f4..a0d9d4bb153d 100644 --- a/pkgs/development/python-modules/keras-preprocessing/default.nix +++ b/pkgs/development/python-modules/keras-preprocessing/default.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, fetchPypi, numpy, six, scipy, pillow, pytest, Keras }: +{ lib, buildPythonPackage, fetchPypi, numpy, six, scipy, pillow, pytest, keras }: buildPythonPackage rec { pname = "Keras_Preprocessing"; @@ -17,7 +17,7 @@ buildPythonPackage rec { ]; checkInputs = [ - pytest Keras + pytest keras ]; checkPhase = '' diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix index 28b09222b472..2b9a269e280f 100644 --- a/pkgs/development/python-modules/keras/default.nix +++ b/pkgs/development/python-modules/keras/default.nix @@ -5,12 +5,13 @@ }: buildPythonPackage rec { - pname = "Keras"; - version = "2.4.3"; + pname = "keras"; + version = "2.7.0"; + format = "wheel"; src = fetchPypi { - inherit pname version; - sha256 = "fedd729b52572fb108a98e3d97e1bac10a81d3917d2103cc20ab2a5f03beb973"; + inherit format pname version; + sha256 = "0c33ae1f728064ca0d35dfba999e9c316f03623bf5688c82fb83cc74a80ea248"; }; checkInputs = [ diff --git a/pkgs/development/python-modules/mask-rcnn/default.nix b/pkgs/development/python-modules/mask-rcnn/default.nix index ae07e7928a6a..2ef6ff5c56d9 100644 --- a/pkgs/development/python-modules/mask-rcnn/default.nix +++ b/pkgs/development/python-modules/mask-rcnn/default.nix @@ -1,10 +1,11 @@ { buildPythonPackage , cython , fetchFromGitHub +, fetchpatch , h5py , imgaug , ipython -, Keras +, keras , lib , matplotlib , numpy @@ -26,13 +27,29 @@ buildPythonPackage rec { sha256 = "13s3q9yh2q9m9vyksd269mww3bni4q2w7q5l419q70ca075qp8zp"; }; + patches = [ + # Fix for TF2: + # https://github.com/matterport/Mask_RCNN/issues/2734 + (fetchpatch { + url = "https://github.com/BupyeongHealer/Mask_RCNN_tf_2.x/commit/7957839fe2b248f2f22c7e991ead12068ddc6cfc.diff"; + excludes = [ "mrcnn/model.py" ]; + sha256 = "sha256-70BGrx6X1uJDA2025f0YTlreT2uB3n35yIzuhf+ypVc="; + }) + ]; + + # Fix for recent Keras + postPatch = '' + substituteInPlace mrcnn/model.py \ + --replace "KE." "KL." + ''; + nativeBuildInputs = [ cython ]; propagatedBuildInputs = [ h5py imgaug ipython - Keras + keras matplotlib numpy opencv3 diff --git a/pkgs/development/python-modules/optuna/default.nix b/pkgs/development/python-modules/optuna/default.nix index b7247083be43..6dde9ededb50 100644 --- a/pkgs/development/python-modules/optuna/default.nix +++ b/pkgs/development/python-modules/optuna/default.nix @@ -9,7 +9,7 @@ , xgboost , mpi4py , lightgbm -, Keras +, keras , mxnet , scikit-optimize , tensorflow @@ -49,7 +49,7 @@ buildPythonPackage rec { xgboost mpi4py lightgbm - Keras + keras mxnet scikit-optimize tensorflow diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index b43ac71ba41e..ae55ac637e97 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -4,7 +4,7 @@ , buildPythonPackage, pythonOlder, python # Python libraries , numpy, tensorflow-tensorboard, absl-py -, setuptools, wheel, Keras, keras-preprocessing, google-pasta +, setuptools, wheel, keras, keras-preprocessing, google-pasta , opt-einsum, astunparse, h5py , termcolor, grpcio, six, wrapt, protobuf, tensorflow-estimator , dill, flatbuffers-python, tblib, typing-extensions @@ -479,7 +479,7 @@ in buildPythonPackage { # Actual tests are slow and impure. # TODO try to run them anyway # TODO better test (files in tensorflow/tools/ci_build/builds/*test) - checkInputs = [ Keras ]; + checkInputs = [ keras ]; checkPhase = '' ${python.interpreter} <