2021-04-26 19:14:03 +00:00
|
|
|
{ boto3
|
|
|
|
, buildPythonPackage
|
|
|
|
, crc32c
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, matplotlib
|
|
|
|
, moto
|
|
|
|
, numpy
|
|
|
|
, pillow
|
|
|
|
, protobuf
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytorch
|
|
|
|
, six
|
|
|
|
, soundfile
|
|
|
|
, tensorflow-tensorboard
|
|
|
|
, torchvision
|
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tensorboardx";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "2.2";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lanpa";
|
|
|
|
repo = "tensorboardX";
|
|
|
|
rev = "v${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "0wjlh5fhamrrff3rm8j5ws9ncblwjgwf3nanxgr1bkn7asgynhys";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
# apparently torch API changed a bit at 1.6
|
|
|
|
postPatch = ''
|
2021-04-26 19:14:03 +00:00
|
|
|
substituteInPlace tensorboardX/pytorch_graph.py --replace \
|
|
|
|
"torch.onnx.set_training(model, False)" \
|
|
|
|
"torch.onnx.select_model_mode_for_export(model, torch.onnx.TrainingMode.EVAL)"
|
2020-11-12 09:05:59 +00:00
|
|
|
'';
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
crc32c
|
|
|
|
numpy
|
|
|
|
protobuf
|
|
|
|
six
|
|
|
|
soundfile
|
|
|
|
];
|
2020-11-12 09:05:59 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
checkInputs = [
|
|
|
|
boto3
|
|
|
|
matplotlib
|
|
|
|
moto
|
|
|
|
pillow
|
|
|
|
pytestCheckHook
|
|
|
|
pytorch
|
|
|
|
tensorflow-tensorboard
|
|
|
|
torchvision
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# ImportError: Visdom visualization requires installation of Visdom
|
|
|
|
"test_TorchVis"
|
|
|
|
# Requires network access (FileNotFoundError: [Errno 2] No such file or directory: 'wget')
|
|
|
|
"test_onnx_graph"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# we are not interested in linting errors
|
|
|
|
"tests/test_lint.py"
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for writing tensorboard-compatible logs";
|
|
|
|
homepage = "https://github.com/lanpa/tensorboardX";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lebastr akamaus ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|