diff --git a/pkgs/development/python-modules/keras-applications/default.nix b/pkgs/development/python-modules/keras-applications/default.nix new file mode 100644 index 00000000000..e06a0b75b50 --- /dev/null +++ b/pkgs/development/python-modules/keras-applications/default.nix @@ -0,0 +1,27 @@ +{ lib, buildPythonPackage, fetchPypi, numpy, h5py }: + +buildPythonPackage rec { + pname = "Keras_Applications"; + version = "1.0.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "8c95300328630ae74fb0828b6fa38269a25c0228a02f1e5181753bfd48961f49"; + }; + + # Cyclic dependency: keras-applications requires keras, which requires keras-applications + postPatch = '' + sed -i "s/keras>=[^']*//" setup.py + ''; + + # No tests in PyPI tarball + doCheck = false; + + propagatedBuildInputs = [ numpy h5py ]; + + meta = with lib; { + description = "Reference implementations of popular deep learning models"; + homepage = https://github.com/keras-team/keras-applications; + license = licenses.mit; + }; +} diff --git a/pkgs/development/python-modules/keras-preprocessing/default.nix b/pkgs/development/python-modules/keras-preprocessing/default.nix new file mode 100644 index 00000000000..043e43eb184 --- /dev/null +++ b/pkgs/development/python-modules/keras-preprocessing/default.nix @@ -0,0 +1,27 @@ +{ lib, buildPythonPackage, fetchPypi, numpy, scipy, six }: + +buildPythonPackage rec { + pname = "Keras_Preprocessing"; + version = "1.0.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "f5306554d2b454d825b36f35e327744f5477bd2ae21017f1a93b2097bed6757e"; + }; + + # Cyclic dependency: keras-preprocessing requires keras, which requires keras-preprocessing + postPatch = '' + sed -i "s/keras>=[^']*//" setup.py + ''; + + # No tests in PyPI tarball + doCheck = false; + + propagatedBuildInputs = [ numpy scipy six ]; + + meta = with lib; { + description = "Easy data preprocessing and data augmentation for deep learning models"; + homepage = https://github.com/keras-team/keras-preprocessing; + license = licenses.mit; + }; +} diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix index 3b221238f3a..ea699c9c04a 100644 --- a/pkgs/development/python-modules/keras/default.nix +++ b/pkgs/development/python-modules/keras/default.nix @@ -1,15 +1,16 @@ { stdenv, buildPythonPackage, fetchPypi , pytest, pytestcov, pytestpep8, pytest_xdist , six, numpy, scipy, pyyaml, h5py +, keras-applications, keras-preprocessing }: buildPythonPackage rec { pname = "Keras"; - version = "2.2.0"; + version = "2.2.2"; src = fetchPypi { inherit pname version; - sha256 = "5b8499d157af217f1a5ee33589e774127ebc3e266c833c22cb5afbb0ed1734bf"; + sha256 = "468d98da104ec5c3dbb10c2ef6bb345ab154f6ca2d722d4c250ef4d6105de17a"; }; checkInputs = [ @@ -21,6 +22,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ six pyyaml numpy scipy h5py + keras-applications keras-preprocessing ]; # Couldn't get tests working diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 159d791e84f..2cc65554284 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16945,6 +16945,10 @@ EOF Keras = callPackage ../development/python-modules/keras { }; + keras-applications = callPackage ../development/python-modules/keras-applications { }; + + keras-preprocessing = callPackage ../development/python-modules/keras-preprocessing { }; + Lasagne = buildPythonPackage rec { name = "Lasagne-${version}"; version = "0.1";