1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonRelaxDepsHook
5, pytest-runner
6# runtime dependencies
7, numpy
8, onnx
9, requests
10, six
11, flatbuffers
12, protobuf
13, tensorflow
14# check dependencies
15, pytestCheckHook
16, graphviz
17, parameterized
18, pytest-cov
19, pyyaml
20, timeout-decorator
21, onnxruntime
22, keras
23}:
24
25buildPythonPackage rec {
26 pname = "tf2onnx";
27 version = "1.15.1";
28 format = "setuptools";
29
30 src = fetchFromGitHub {
31 owner = "onnx";
32 repo = "tensorflow-onnx";
33 rev = "refs/tags/v${version}";
34 hash = "sha256-HqzcoPPX9+NOj0uFfOSVI2MNCkxq1NmLqXflwdi5RF0=";
35 };
36
37 nativeBuildInputs = [
38 pythonRelaxDepsHook
39 pytest-runner
40 ];
41
42 pythonRelaxDeps = [
43 "flatbuffers"
44 ];
45
46 propagatedBuildInputs = [
47 numpy
48 onnx
49 requests
50 six
51 flatbuffers
52 protobuf
53 tensorflow
54 onnxruntime
55 ];
56
57 pythonImportsCheck = [ "tf2onnx" ];
58
59 nativeCheckInputs = [
60 pytestCheckHook
61 graphviz
62 parameterized
63 pytest-cov
64 pyyaml
65 timeout-decorator
66 keras
67 ];
68
69 # TODO investigate the failures
70 disabledTestPaths = [
71 "tests/test_backend.py"
72 "tests/test_einsum_helper.py"
73 "tests/test_einsum_optimizers.py"
74 ];
75
76 disabledTests = [
77 "test_profile_conversion_time"
78 ];
79
80 meta = with lib; {
81 description = "Convert TensorFlow, Keras, Tensorflow.js and Tflite models to ONNX";
82 homepage = "https://github.com/onnx/tensorflow-onnx";
83 license = licenses.asl20;
84 maintainers = with maintainers; [ happysalada ];
85 };
86}