Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error #13

Open
exyzzy opened this issue May 8, 2023 · 9 comments
Open

Build error #13

exyzzy opened this issue May 8, 2023 · 9 comments

Comments

@exyzzy
Copy link

exyzzy commented May 8, 2023

Hello,

I'm on Mac m2, I think my go env is ok, and the basic gcc test for libtensorflow works fine. However, when I try to build your hello TensorFlow example here I get the following. Any ideas? Thanks

% go install
# github.com/wamuir/graft/tensorflow
../../../../pkg/mod/github.com/wamuir/[email protected]/tensorflow/tensor.go:69:26: could not determine kind of name for C.TF_FLOAT8_E4M3FN
../../../../pkg/mod/github.com/wamuir/[email protected]/tensorflow/tensor.go:68:26: could not determine kind of name for C.TF_FLOAT8_E5M2
@wamuir
Copy link
Owner

wamuir commented May 8, 2023 via email

@exyzzy
Copy link
Author

exyzzy commented May 8, 2023

derp, yes, that was it. All is good. Thanks

@janhartman
Copy link

Hey @exyzzy, I'm curious as to how you got libtensorflow to work on your Mac.
I have an M1 Mac and for some reason, even libtensorflow that I built myself (tried different versions, from 2.7 to 2.14) doesn't want to work. The funny thing is that it worked up to approx. this September and stopped after a MacOS update.
If you can share any info it would be extremely helpful, thanks in advance! :)

@janhartman
Copy link

Figured it out - had to manually set DYLD_LIBRARY_PATH=/usr/local/lib. It didn't occur to me to try it before as I assumed this directory would be included by default.

@ariden83
Copy link

ariden83 commented Jun 19, 2024

horrible, by requiring me to fix the problem above, I am destroying my tensorflow installation... it's getting worse and worse... with messages such as:

2024-06-19 16: 45:58.857890: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

2024-06-19 16:45:59.507007: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

Was it not possible to indicate which version of tensorflow is compatible with the latest lib update in the readme ?

@wamuir
Copy link
Owner

wamuir commented Jun 20, 2024

@ariden83

2024-06-19 16: 45:58.857890: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

You have chosen to use a build of libtensorflow that does not take advantage of several CPU instructions. This is an informational message. Ignore it, use a different libtensorflow build, or compile libtensorflow yourself to use these instructions. If you don't like the info message then you should open an issue at: https://github.com/tensorflow/tensorflow.

2024-06-19 16:45:59.507007: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

What did you expect? Did you install TensorRT? https://developer.nvidia.com/tensorrt

Was it not possible to indicate which version of tensorflow is compatible with the latest lib update in the readme ?

This information is listed clearly on the releases page https://github.com/wamuir/graft/releases

@ariden83
Copy link

ariden83 commented Jul 8, 2024

Still me, even using a docker image, I always encounter this error, can you help me.

  1. FROM nvcr.io/nvidia/tensorflow:24.01-tf2-py3
  2. curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.8.0.tar.gz" | tar -C /usr/local -xz
  3. github.com/wamuir/graft v0.6.0

CF:

  1. I create this dockerfile with TensorFlow Version 2.14.0 :

https://github.com/ariden83/gocomments/blob/main/api/Dockerfile
(using this image https://github.com/ariden83/gocomments/blob/main/model/Dockerfile (model_tensorflow-container))

  1. In the previous docker file we've got :
    RUN curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.8.0.tar.gz" | tar -C /usr/local -xz

  2. In my GO mod, i required graft v0.6.0 :
    https://github.com/ariden83/gocomments/blob/main/api/go.mod > github.com/wamuir/graft v0.6.0

(I also tested with more old and recent versions of wamuir/graft 4.0, 4.1, 5, 5.1, 6, 6.1, 7, 8)

I've always got this error

github.com/wamuir/graft/tensorflow

vendor/github.com/wamuir/graft/tensorflow/tensor.go:69:26: could not determine kind of name for C.TF_FLOAT8_E4M3FN
vendor/github.com/wamuir/graft/tensorflow/tensor.go:68:26: could not determine kind of name for C.TF_FLOAT8_E5M2

Could you help me to modify the dockerfile ?

@wamuir
Copy link
Owner

wamuir commented Jul 8, 2024

@ariden83 Assuming your machine is amd_64:

FROM golang:1.21-bookworm

RUN curl -L https://storage.googleapis.com/tensorflow/versions/2.16.1/libtensorflow-cpu-linux-$(uname -m).tar.gz \
    | tar xz --directory /usr/local \
    && ldconfig

WORKDIR /app
RUN curl -fSLs https://raw.githubusercontent.com/wamuir/graft/nightly/tools/graft_package/_libtensorflow_graft_hello.go\
    > hello_tf.go \
    && go mod init graft-test-app \
    && go get github.com/wamuir/[email protected] \
    && go mod tidy

ENTRYPOINT ["go", "run"]

@ariden83
Copy link

ariden83 commented Jul 8, 2024

Thank you very much, its works well in local and in an docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants