Something went wrong. Try again.
lol
Something went wrong. Try again.
5.1 kB · 175 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176{ lib, stdenv, buildPythonPackage, fetchFromGitHub,
# build-system setuptools,
# dependencies absl-py, distutils, h5py, ml-dtypes, namex, numpy, onnxruntime, optree, orbax-checkpoint, packaging, pythonAtLeast, rich, scikit-learn, tensorflow, tf2onnx,
# tests dm-tree, jax, pandas, pydot, pytestCheckHook, tf-keras, torch, writableTmpDirAsHomeHook,}:
buildPythonPackage (finalAttrs: { pname = "keras"; version = "3.14.0"; pyproject = true;
src = fetchFromGitHub { owner = "keras-team"; repo = "keras"; tag = "v${finalAttrs.version}"; hash = "sha256-EMwqo+0mIwjDY3wKW4idiAczSSPIGjTRNIYlqPDwd+w="; };
build-system = [ setuptools ];
dependencies = [ absl-py h5py ml-dtypes namex numpy onnxruntime optree orbax-checkpoint packaging rich scikit-learn tensorflow tf2onnx ] ++ lib.optionals (pythonAtLeast "3.12") [ distutils ];
pythonImportsCheck = [ "keras" "keras._tf_keras" ];
nativeCheckInputs = [ dm-tree jax pandas pydot pytestCheckHook tf-keras torch writableTmpDirAsHomeHook ];
disabledTests = [ # Require unpackaged `grain` "test_basics_grain" "test_fit_with_data_adapter_grain_dataloader" "test_fit_with_data_adapter_grain_datast" "test_fit_with_data_adapter_grain_datast_with_len" "test_image_dataset_from_directory_binary_grain" "test_image_dataset_from_directory_color_modes_grain" "test_image_dataset_from_directory_crop_to_aspect_ratio_grain" "test_image_dataset_from_directory_follow_links_grain" "test_image_dataset_from_directory_manual_labels_grain" "test_image_dataset_from_directory_multiclass_grain" "test_image_dataset_from_directory_no_labels_grain" "test_image_dataset_from_directory_not_batched_grain" "test_image_dataset_from_directory_pad_to_aspect_ratio_grain" "test_image_dataset_from_directory_shuffle_grain" "test_image_dataset_from_directory_validation_split_grain" "test_no_targets_grain" "test_not_batched_grain" "test_sample_count_grain" "test_sampling_rate_grain" "test_sequence_stride_grain" "test_shuffle_grain" "test_start_and_end_index_grain" "test_text_dataset_from_directory_binary_grain" "test_text_dataset_from_directory_follow_links_grain" "test_text_dataset_from_directory_manual_labels_grain" "test_text_dataset_from_directory_multiclass_grain" "test_text_dataset_from_directory_not_batched_grain" "test_text_dataset_from_directory_standalone_grain" "test_text_dataset_from_directory_validation_split_grain" "test_timeseries_regression_grain"
# Tries to install the package in the sandbox "test_keras_imports"
# TypeError: this __dict__ descriptor does not support '_DictWrapper' objects "test_reloading_default_saved_model" ] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ # Hangs forever "test_fit_with_data_adapter" ];
disabledTestPaths = [ # Require unpackaged `grain` "keras/src/layers/preprocessing/data_layer_test.py" "keras/src/layers/preprocessing/discretization_test.py" "keras/src/layers/preprocessing/image_preprocessing/resizing_test.py" "keras/src/layers/preprocessing/rescaling_test.py" "keras/src/layers/preprocessing/string_lookup_test.py" "keras/src/layers/preprocessing/text_vectorization_test.py" "keras/src/trainers/data_adapters/grain_dataset_adapter_test.py"
# These tests succeed when run individually, but crash within the full test suite: # ImportError: /nix/store/4bw0x7j3wfbh6i8x3plmzknrdwdzwfla-abseil-cpp-20240722.1/lib/libabsl_cord_internal.so.2407.0.0: # undefined symbol: _ZN4absl12lts_2024072216strings_internal13StringifySink6AppendESt17basic_string_viewIcSt11char_traitsIcEE "keras/src/export/onnx_test.py"
# Require internet access "integration_tests/dataset_tests" "keras/src/applications/applications_test.py"
# TypeError: test_custom_fit.<locals>.CustomModel.train_step() missing 1 required positional argument: 'data' "integration_tests/jax_custom_fit_test.py"
# RuntimeError: Virtual devices cannot be modified after being initialized "integration_tests/tf_distribute_training_test.py"
# AttributeError: 'CustomModel' object has no attribute 'zero_grad' "integration_tests/torch_custom_fit_test.py"
# Fails for an unclear reason: # self.assertLen(list(net.parameters()), 2 # AssertionError: 0 != 2 "integration_tests/torch_workflow_test.py"
# TypeError: this __dict__ descriptor does not support '_DictWrapper' objects "keras/src/backend/tensorflow/saved_model_test.py" ];
meta = { description = "Multi-backend implementation of the Keras API, with support for TensorFlow, JAX, and PyTorch"; homepage = "https://keras.io"; changelog = "https://github.com/keras-team/keras/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ GaetanLepage ]; };})