yaroslavvb / tensorflow-community-wheels

Place to upload links to TensorFlow wheels
452 stars 35 forks source link

TensorFlow 2.13.0, CPU, Linux, py3.10, SSE4.1 #223

Open tomeeeS opened 11 months ago

tomeeeS commented 11 months ago

https://github.com/tomeeeS/tf_builds/blob/main/tensorflow-2.13.0-cp310-cp310-linux_x86_64.whl "Download raw file" button, or from cmd wget https://github.com/tomeeeS/tf_builds/raw/main/tensorflow-2.13.0-cp310-cp310-linux_x86_64.whl?download= untar (tar -xf tensorflow*), use the .whl. You don't need the other folders it extracts.

Commands used for build:

git config --global core.autocrlf input  # very important!!!  otherwise your bazel build will fail, because an invoked shell script will have Windows line endings.
git config --global core.eol lf
git clone https://github.com/tensorflow/tensorflow.git &
cd tensorflow
git checkout -b r2.13 origin/r2.13
apt install python3.10-venv
cd ..

python3 -m venv tf_venv
tf_venv/bin/pip install -U pip numpy wheel packaging requests opt_einsum
tf_venv/bin/pip install -U keras_preprocessing --no-deps

wget https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64
mv bazelisk-linux-amd64 bazel
chmod +x bazel
mv -v bazel /usr/local/bin

installing clang-16 is not necessary! bazel will dl and use one. 

cd tensorflow
../tf_venv/bin/python3 configure.py 
(dl clang: N (! No!, yet bazel will dl and use one), opti flag: -msse4.1)
bazel build  --local_ram_resources=2048 --jobs=4 --verbose_failures  //tensorflow/tools/pip_package:build_pip_package   # adds up to max 8GB RAM usage (local_ram_resources in MB * jobs)
Cthuulhaa commented 8 months ago

Hi, sorry, this may be a newbie question, but in which directory is the compiled Tensorflow wheel?

Cheers!

tomeeeS commented 8 months ago

@Cthuulhaa Hi, no worries, after you open the link, you just have to click the download button at the top right. It's to the right of "Raw". It only downloads the .whl (the wheel). If however you have cloned the repo, you would need to install git lfs and pull it with that (much more complicated).

FrankyDBravo commented 8 months ago

Amazing thanks! I am trying to do the same for a Python 3.11.5 with tensorflow 2.14 (CPU) ( that would work on a docker amd64 ubuntu that is running on a MAC M1). I fail to create the wheel.. Do you know where I could find it ?

Best!

Cthuulhaa commented 8 months ago

Amazing thanks! I am trying to do the same for a Python 3.11.5 with tensorflow 2.14 (CPU) ( that would work on a docker amd64 ubuntu that is running on a MAC M1). I fail to create the wheel.. Do you know where I could find it ?

Best!

If building the package builder was sucessful, you will then have to run the executable build_pip_package in the bazel-bin/tensorflow/tools/pip_package directory to create the .whl:

./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

An then install the Tensorflow wheel:

pip install -U /tmp/tensorflow_pkg/tensorflow-version-tags.whl

FrankyDBravo commented 7 months ago

Great thanks.. I am still struggling to create a version that would work on a docker ( x86_64), the container running on a mac M1. Specifically for a python 3.11 and tf 2.14 ... ? anyone can help ?

FrankyDBravo commented 7 months ago

i am really struggling and would gift anyone that could provide me the wheel