2020-06-30 07:59:39 +00:00
|
|
|
{ boto3, buildPythonPackage, crc32c, fetchFromGitHub, lib, matplotlib, moto
|
|
|
|
, numpy, pillow, pytorch, protobuf, six, pytestCheckHook
|
|
|
|
, tensorflow-tensorboard, torchvision }:
|
2019-01-04 21:20:43 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tensorboardx";
|
2021-03-24 17:41:57 +00:00
|
|
|
version = "2.1";
|
2019-01-04 21:20:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lanpa";
|
|
|
|
repo = "tensorboardX";
|
|
|
|
rev = "v${version}";
|
2021-03-24 17:41:57 +00:00
|
|
|
sha256 = "1palz91y0b39pcmwg6wdmqfal38hai99dd6r88i3imqxdbmjghih";
|
2019-01-04 21:20:43 +00:00
|
|
|
};
|
|
|
|
|
2020-06-30 07:59:39 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook boto3 crc32c matplotlib moto pillow pytorch tensorflow-tensorboard torchvision
|
|
|
|
];
|
2019-01-04 21:20:43 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy protobuf six ];
|
|
|
|
|
2020-09-05 20:46:04 +00:00
|
|
|
# apparently torch API changed a bit at 1.6
|
|
|
|
postPatch = ''
|
|
|
|
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-06-30 07:59:39 +00:00
|
|
|
disabledTests = [ "test_TorchVis" "test_onnx_graph" ];
|
2019-01-04 21:20:43 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for writing tensorboard-compatible logs";
|
2020-06-30 07:59:39 +00:00
|
|
|
homepage = "https://github.com/lanpa/tensorboardX";
|
2019-01-04 21:20:43 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lebastr akamaus ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|