34 buildPythonPackage rec {
39 src = fetchFromGitHub {
42 rev = "refs/tags/v${version}";
43 hash = "sha256-qidY1OmlOYPKVoxryx1bEukA7IS6rPV4jqlnuf3y39w=";
60 ] ++ lib.optionals (pythonAtLeast "3.12") [ distutils ];
62 pythonImportsCheck = [
79 export HOME=$(mktemp -d)
84 # Tries to install the package in the sandbox
87 # TypeError: this __dict__ descriptor does not support '_DictWrapper' objects
88 "test_reloading_default_saved_model"
90 ++ lib.optionals stdenv.isDarwin [
91 # AttributeError: module 'numpy' has no attribute 'float128'. Did you mean: 'float16'?
92 "test_spectrogram_error"
96 # Datasets are downloaded from the internet
97 "integration_tests/dataset_tests"
99 # TypeError: test_custom_fit.<locals>.CustomModel.train_step() missing 1 required positional argument: 'data'
100 "integration_tests/jax_custom_fit_test.py"
102 # RuntimeError: Virtual devices cannot be modified after being initialized
103 "integration_tests/tf_distribute_training_test.py"
105 # AttributeError: 'CustomModel' object has no attribute 'zero_grad'
106 "integration_tests/torch_custom_fit_test.py"
108 # Fails for an unclear reason:
109 # self.assertLen(list(net.parameters()), 2
110 # AssertionError: 0 != 2
111 "integration_tests/torch_workflow_test.py"
113 # Most tests require internet access
114 "keras/src/applications/applications_test.py"
116 # TypeError: this __dict__ descriptor does not support '_DictWrapper' objects
117 "keras/src/backend/tensorflow/saved_model_test.py"
118 "keras/src/export/export_lib_test.py"
120 # KeyError: 'Unable to synchronously open object (bad object header version number)'
121 "keras/src/saving/file_editor_test.py"
125 description = "Multi-backend implementation of the Keras API, with support for TensorFlow, JAX, and PyTorch";
126 homepage = "https://keras.io";
127 changelog = "https://github.com/keras-team/keras/releases/tag/v${version}";
128 license = lib.licenses.mit;
129 maintainers = with lib.maintainers; [ GaetanLepage ];