tensorflow and tensorflow lite is broken

  • Done
  • quality assurance status badge
Details
3 participants
  • Andy Tai
  • Enrico Schwass
  • Ludovic Courtès
Owner
unassigned
Submitted by
Enrico Schwass
Severity
normal
E
E
Enrico Schwass wrote on 21 Aug 16:04 +0200
(address . bug-guix@gnu.org)
4AB3AB32-7D01-4DFE-B5B9-DB9F0FAC84FA@me.com
Hello

It seems, that the current version of tensorflow-lite 2.13.1 does not build because of the flatbuffers version it depends on. Before guix updated its flatbuffers version it was doing well.

I don‘t know if package transformations help here. Never got it right

Bye
Enno
A
A
Andy Tai wrote on 28 Aug 16:23 +0200
[PATCH] gnu: tensorflow-lite: Fix build.
(address . 72747@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
8bfafcc3ab6ce559f3ff920d2da28e4ff26e5678.1724854978.git.atai@atai.org
* gnu/packages/machine-learning.scm (tensorflow-lite): Fix build.
[inputs]: Change flatbuffers-next to flatbuffers-23.1.

* gnu/packages/serialization.scm (flatbuffers-23.1): New variable.

Change-Id: I257c3563cb91cbf8e0f0874367aafced248ab4dc
---
gnu/packages/machine-learning.scm | 2 +-
gnu/packages/serialization.scm | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)

Toggle diff (43 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 4c5b713cbf..fd790e4455 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3487,7 +3487,7 @@ (define-public tensorflow-lite
("cpuinfo" ,cpuinfo)
("eigen" ,eigen)
("fp16" ,fp16)
- ("flatbuffers" ,flatbuffers-next)
+ ("flatbuffers" ,flatbuffers-23.1)
("gemmlowp" ,gemmlowp)
("mesa-headers" ,mesa-headers)
("neon2sse" ,neon2sse)
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 6aaf416467..c33b251b13 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -899,6 +899,21 @@ (define-public flatbuffers
game development and other performance-critical applications.")
(license license:asl2.0)))
+(define-public flatbuffers-23.1
+ ;; needed explicitly by tensorflow-lite 2.13.1
+ (package
+ (inherit flatbuffers)
+ (version "23.1.21")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/google/flatbuffers")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "flatbuffers" version))
+ (sha256
+ (base32
+ "1z3a6l8g2y53i5xzraswfs2i0i3kk52zv7nzc2q3fgisbyiri3pz"))))))
+
(define-public flatbuffers-next
(package
(inherit flatbuffers)

base-commit: 53396a22afc04536ddf75d8f82ad2eafa5082725
--
2.34.1
A
A
Andy Tai wrote on 28 Aug 16:47 +0200
[PATCH v2] gnu: tensorflow-lite: Fix build.
(address . 72747@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
738b4e753d8cd8dc84180f9fd31d66cc483b97ee.1724856448.git.atai@atai.org
* gnu/packages/machine-learning.scm (tensorflow-lite): Fix build.
[inputs]: Change flatbuffers-next to flatbuffers-23.1.

* gnu/packages/serialization.scm (flatbuffers-23.1): New variable.

Change-Id: I257c3563cb91cbf8e0f0874367aafced248ab4dc
---
gnu/packages/machine-learning.scm | 2 +-
gnu/packages/serialization.scm | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 4c5b713cbf..fd790e4455 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3487,7 +3487,7 @@ (define-public tensorflow-lite
("cpuinfo" ,cpuinfo)
("eigen" ,eigen)
("fp16" ,fp16)
- ("flatbuffers" ,flatbuffers-next)
+ ("flatbuffers" ,flatbuffers-23.1)
("gemmlowp" ,gemmlowp)
("mesa-headers" ,mesa-headers)
("neon2sse" ,neon2sse)
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 6aaf416467..31d3ed9feb 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -899,6 +899,25 @@ (define-public flatbuffers
game development and other performance-critical applications.")
(license license:asl2.0)))
+(define-public flatbuffers-23.1
+ ;; needed explicitly by tensorflow-lite 2.13.1
+ (package
+ (inherit flatbuffers)
+ (version "23.1.21")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/google/flatbuffers")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "flatbuffers" version))
+ (sha256
+ (base32
+ "1z3a6l8g2y53i5xzraswfs2i0i3kk52zv7nzc2q3fgisbyiri3pz"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments flatbuffers)
+ ((#:configure-flags flags #~'())
+ #~(append #$flags '("-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))))))
+
(define-public flatbuffers-next
(package
(inherit flatbuffers)

base-commit: 53396a22afc04536ddf75d8f82ad2eafa5082725
--
2.34.1
A
A
Andy Tai wrote on 31 Aug 01:00 +0200
(name . GNU bug tracker automated control server)(address . control@debbugs.gnu.org)
CAJsg1E-yZGY9Jt_eZY0XWR4ajckNMNbi8b_LkbYyNWAOZ0BGSQ@mail.gmail.com
reassign 72747 guix-patches
thanks
A
A
Andy Tai wrote on 2 Sep 00:24 +0200
(address . 72747@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
88cf7d511753f57ed76361c05a330af8ddb770bd.1725229444.git.atai@atai.org
* gnu/packages/machine-learning.scm (tensorflow-lite): Fix build.
[inputs]: Change flatbuffers-next to flatbuffers-23.1.

* gnu/packages/serialization.scm (flatbuffers-23.1): New variable.

Change-Id: I257c3563cb91cbf8e0f0874367aafced248ab4dc
---
gnu/packages/machine-learning.scm | 2 +-
gnu/packages/serialization.scm | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 62b9ac00e9..20c49a6422 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3487,7 +3487,7 @@ (define-public tensorflow-lite
("cpuinfo" ,cpuinfo)
("eigen" ,eigen)
("fp16" ,fp16)
- ("flatbuffers" ,flatbuffers-next)
+ ("flatbuffers" ,flatbuffers-23.1)
("gemmlowp" ,gemmlowp)
("mesa-headers" ,mesa-headers)
("neon2sse" ,neon2sse)
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 6aaf416467..31d3ed9feb 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -899,6 +899,25 @@ (define-public flatbuffers
game development and other performance-critical applications.")
(license license:asl2.0)))
+(define-public flatbuffers-23.1
+ ;; needed explicitly by tensorflow-lite 2.13.1
+ (package
+ (inherit flatbuffers)
+ (version "23.1.21")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/google/flatbuffers")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "flatbuffers" version))
+ (sha256
+ (base32
+ "1z3a6l8g2y53i5xzraswfs2i0i3kk52zv7nzc2q3fgisbyiri3pz"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments flatbuffers)
+ ((#:configure-flags flags #~'())
+ #~(append #$flags '("-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))))))
+
(define-public flatbuffers-next
(package
(inherit flatbuffers)

base-commit: 61a7930cb03f5eb9e8003bade21d61262c3db8df
--
2.34.1
L
L
Ludovic Courtès wrote on 3 Sep 11:55 +0200
Re: bug#72747: tensorflow and tensorflow lite is broken
(name . Andy Tai)(address . atai@atai.org)(address . 72747-done@debbugs.gnu.org)
87ed61hxj3.fsf_-_@gnu.org
Andy Tai <atai@atai.org> skribis:

Toggle quote (7 lines)
> * gnu/packages/machine-learning.scm (tensorflow-lite): Fix build.
> [inputs]: Change flatbuffers-next to flatbuffers-23.1.
>
> * gnu/packages/serialization.scm (flatbuffers-23.1): New variable.
>
> Change-Id: I257c3563cb91cbf8e0f0874367aafced248ab4dc

Applied, thanks!
Closed
E
E
Enrico Schwass wrote on 3 Sep 12:16 +0200
tensorflow and tensorflow lite is broken
(address . 72747@debbugs.gnu.org)
0E2869C3-A934-4D28-9458-2C6E56479614@me.com
Hello

Thank you Andy and Ludovic for creating the patch and for applying it.

The same patch would work for the full tensorflow package, provided by the guix-science channel. *nudge nudge*.

I am not sure if there is an ML team for Guix, but if not - regarding the hotness of the topic - it would be nice to have one. I can provide simpler packages and test on M1, x86 and if I finally set it up on honeycomb.

Thank you again
Enno
?
Your comment

This issue is archived.

To comment on this conversation send an email to 72747@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72747
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch