You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alright, I am having deep trouble to get this stuff up and running inside me project.
So first I've tried to compile on Mac, natively, with musl, with zig cc. Various errors, but most often that, tried to add -I/ -L flags to point out to downloaded package from google, nothing always more or less this error:
/root/go/pkg/mod/github.com/galeone/tensorflow/tensorflow/go@v0.0.0-20221023090153-6b7fa0680c3e/attrs.go:20:11: fatal error: tensorflow/c/c_api.h: No such file or directory
20 | // #include "tensorflow/c/c_api.h"
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
So alright, there is the added difficulty with ARM64 and x64_86 libs, so...why not try a docker, with the image listed on this github:
FROM tensorflow/tensorflow:2.9.1
RUN apt-get update && apt-get install -y \
wget \
git \
gcc \
build-essential
ENV GOLANG_VERSION 1.20.3
RUN wget https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
rm go${GOLANG_VERSION}.linux-amd64.tar.gz
ENV PATH /usr/local/go/bin:$PATH
WORKDIR /app
COPY . .
RUN go get -d -v ./... && \
CGO_ENABLED=1 go build -o main .
LABEL authors="M1chl"
ENTRYPOINT ["./main", "arg1"]
Well no dice, same error. I by no means want to waste any ones time, but I would really need to get this up and running.
Does anyone has any suggestion how to fix it?
The text was updated successfully, but these errors were encountered:
Alright I managed to fixed with help of our ML/AI overlords
# Use the official Golang image as the base image
FROM golang:1.20.3 as builder
# Install required dependencies
RUN apt-get update && apt-get install -y \
wget \
git \
gcc \
build-essential
# Download and install TensorFlow C library
RUN wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz && \
tar -C /usr -xzf libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz && \
ldconfig && \
rm libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz
# Set the environment variables to help the Go compiler find the TensorFlow C library
ENV LD_LIBRARY_PATH /usr/local/lib
ENV CGO_CFLAGS "-I/usr/local/include"
ENV CGO_LDFLAGS "-L/usr/local/lib"
# Create a working directory for your Go project
WORKDIR /app
# Copy the Go project files into the container
COPY . .
# Build the Go project
RUN go mod tidy && \
go build -o main .
#Use the official TensorFlow image as the base image
FROM ubuntu:22.04
COPY --from=builder /app/main .
COPY --from=builder /usr/lib/libtensorflow.so.2 /usr/local/lib/
COPY --from=builder /usr/lib/libtensorflow_framework.so.2 /usr/local/lib/
# Set the environment variables to help the runtime find the TensorFlow C library
ENV LD_LIBRARY_PATH /usr/local/lib
LABEL authors="M1chl"
ENTRYPOINT ["./main"]
Alright, I am having deep trouble to get this stuff up and running inside me project.
So first I've tried to compile on Mac, natively, with musl, with zig cc. Various errors, but most often that, tried to add -I/ -L flags to point out to downloaded package from google, nothing always more or less this error:
So alright, there is the added difficulty with ARM64 and x64_86 libs, so...why not try a docker, with the image listed on this github:
Well no dice, same error. I by no means want to waste any ones time, but I would really need to get this up and running.
Does anyone has any suggestion how to fix it?
The text was updated successfully, but these errors were encountered: