2022-01-03 16:56:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2022-01-03 16:56:52 +00:00
|
|
|
, jaxlib
|
2023-11-16 04:20:00 +00:00
|
|
|
, jax
|
2022-01-03 16:56:52 +00:00
|
|
|
, numpy
|
|
|
|
, parameterized
|
|
|
|
, pillow
|
|
|
|
, scipy
|
2022-04-15 01:41:22 +00:00
|
|
|
, tensorboard
|
2023-11-16 04:20:00 +00:00
|
|
|
, keras
|
|
|
|
, pytestCheckHook
|
|
|
|
, 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-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
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
|
|
|
};
|
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
# Avoid propagating the dependency on `jaxlib`, see
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/156767
|
|
|
|
buildInputs = [
|
|
|
|
jaxlib
|
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jax
|
|
|
|
numpy
|
|
|
|
parameterized
|
|
|
|
pillow
|
|
|
|
scipy
|
2022-04-15 01:41:22 +00:00
|
|
|
tensorboard
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"objax"
|
|
|
|
];
|
|
|
|
|
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
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests/*.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Test requires internet access for prefetching some weights
|
|
|
|
"test_pretrained_keras_weight_0_ResNet50V2"
|
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Objax is a machine learning framework that provides an Object Oriented layer for JAX.";
|
|
|
|
homepage = "https://github.com/google/objax";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ndl ];
|
|
|
|
};
|
|
|
|
}
|