2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-09-19 14:19:46 +00:00
|
|
|
stdenv,
|
2024-06-05 15:53:02 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-09-19 14:19:46 +00:00
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook,
|
|
|
|
pytest-xdist,
|
|
|
|
torchvision,
|
|
|
|
matplotlib,
|
|
|
|
mock,
|
|
|
|
packaging,
|
|
|
|
torch,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ignite";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.5.1";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pytorch";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-J0xrqAGwH0bAs59T7zA8irMWOGbE2+Zd9kwqxYUYYMA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
packaging
|
|
|
|
torch
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
matplotlib
|
|
|
|
mock
|
|
|
|
pytest-xdist
|
|
|
|
torchvision
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# runs successfully in 3.9, however, async isn't correctly closed so it will fail after test suite.
|
2020-12-07 07:45:13 +00:00
|
|
|
doCheck = pythonOlder "3.9";
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
# Some packages are not in NixPkgs; other tests try to build distributed
|
|
|
|
# models, which doesn't work in the sandbox.
|
2020-12-07 07:45:13 +00:00
|
|
|
# avoid tests which need special packages
|
|
|
|
pytestFlagsArray = [
|
2021-08-05 21:33:18 +00:00
|
|
|
"--ignore=tests/ignite/contrib/handlers/test_clearml_logger.py"
|
|
|
|
"--ignore=tests/ignite/contrib/handlers/test_lr_finder.py"
|
2020-12-07 07:45:13 +00:00
|
|
|
"--ignore=tests/ignite/contrib/handlers/test_trains_logger.py"
|
2021-08-05 21:33:18 +00:00
|
|
|
"--ignore=tests/ignite/metrics/nlp/test_bleu.py"
|
|
|
|
"--ignore=tests/ignite/metrics/nlp/test_rouge.py"
|
2021-08-08 23:34:03 +00:00
|
|
|
"--ignore=tests/ignite/metrics/gan" # requires pytorch_fid; tries to download model to $HOME
|
2020-12-07 07:45:13 +00:00
|
|
|
"--ignore=tests/ignite/metrics/test_dill.py"
|
2021-08-05 21:33:18 +00:00
|
|
|
"--ignore=tests/ignite/metrics/test_psnr.py"
|
2020-12-07 07:45:13 +00:00
|
|
|
"--ignore=tests/ignite/metrics/test_ssim.py"
|
|
|
|
"tests/"
|
|
|
|
];
|
|
|
|
|
|
|
|
# disable tests which need specific packages
|
|
|
|
disabledTests = [
|
|
|
|
"idist"
|
|
|
|
"mlflow"
|
2021-08-05 21:33:18 +00:00
|
|
|
"tensorboard"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_gpu_info" # needs pynvml
|
2020-12-07 07:45:13 +00:00
|
|
|
"test_integration"
|
2021-08-05 21:33:18 +00:00
|
|
|
"test_output_handler" # needs mlflow
|
2020-12-07 07:45:13 +00:00
|
|
|
"test_pbar" # slight output differences
|
2021-08-05 21:33:18 +00:00
|
|
|
"test_setup_clearml_logging"
|
|
|
|
"test_setup_neptune"
|
2020-12-07 07:45:13 +00:00
|
|
|
"test_setup_plx"
|
2021-08-05 21:33:18 +00:00
|
|
|
"test_write_results"
|
|
|
|
"trains"
|
|
|
|
"visdom"
|
2020-12-07 07:45:13 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"ignite"
|
|
|
|
"ignite.engine"
|
|
|
|
"ignite.handlers"
|
|
|
|
"ignite.metrics"
|
|
|
|
"ignite.distributed"
|
|
|
|
"ignite.exceptions"
|
|
|
|
"ignite.utils"
|
|
|
|
"ignite.contrib"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "High-level training library for PyTorch";
|
2024-09-19 14:19:46 +00:00
|
|
|
homepage = "https://pytorch-ignite.ai";
|
|
|
|
changelog = "https://github.com/pytorch/ignite/releases/tag/v${version}";
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
maintainers = [ lib.maintainers.bcdarwin ];
|
|
|
|
# ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
|
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|