2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
jax,
|
|
|
|
jaxlib,
|
|
|
|
keras,
|
|
|
|
numpy,
|
|
|
|
parameterized,
|
|
|
|
pillow,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
scipy,
|
|
|
|
setuptools,
|
|
|
|
tensorboard,
|
|
|
|
tensorflow,
|
2022-01-03 16:56:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "objax";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.8.0";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "objax";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-WD+pmR8cEay4iziRXqF3sHUzCMBjmLJ3wZ3iYOD+hzk=";
|
2022-01-03 16:56:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [
|
|
|
|
# Issue reported upstream: https://github.com/google/objax/issues/270
|
|
|
|
./replace-deprecated-device_buffers.patch
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
# Avoid propagating the dependency on `jaxlib`, see
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/156767
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ jaxlib ];
|
2022-01-27 00:19:43 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2022-01-03 16:56:52 +00:00
|
|
|
jax
|
|
|
|
numpy
|
|
|
|
parameterized
|
|
|
|
pillow
|
|
|
|
scipy
|
2022-04-15 01:41:22 +00:00
|
|
|
tensorboard
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "objax" ];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# This is necessay to ignore the presence of two protobufs version (tensorflow is bringing an
|
|
|
|
# older version).
|
|
|
|
catchConflicts = false;
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
keras
|
|
|
|
pytestCheckHook
|
|
|
|
tensorflow
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "tests/*.py" ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Test requires internet access for prefetching some weights
|
|
|
|
"test_pretrained_keras_weight_0_ResNet50V2"
|
2024-02-29 20:09:43 +00:00
|
|
|
# ModuleNotFoundError: No module named 'tree'
|
|
|
|
"TestResNetV2Pretrained"
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
meta = with lib; {
|
2024-02-29 20:09:43 +00:00
|
|
|
description = "Machine learning framework that provides an Object Oriented layer for JAX";
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://github.com/google/objax";
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/google/objax/releases/tag/v${version}";
|
2022-01-03 16:56:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ndl ];
|
|
|
|
};
|
|
|
|
}
|