Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeeeanut committed Jul 16, 2024
1 parent 707228e commit 83d7302
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 8 deletions.
15 changes: 15 additions & 0 deletions 24-07/tensorflow/shell/tf-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ start=$(date +%s)
sudo dnf install python3-devel python3-pip -y
# 安装 bazel 软件包依赖项
sudo dnf install build-essential python zip unzip java-11-openjdk-devel -y
# 安装基本的工具
sudo dnf install patchelf -y

# 创建虚拟环境
python -m venv venv00
Expand Down Expand Up @@ -42,6 +44,19 @@ git checkout tags/v2.15.0
# 创建软链接
sudo ln -s /usr/bin/aarch64-openEuler-linux-gcc /usr/bin/aarch64-linux-gnu-gcc
bazel build //tensorflow/tools/pip_package:build_pip_package --local_ram_resources=1024 --jobs=12
WORKSPACE=$(pwd)
./bazel-bin/tensorflow/tools/pip_package/build_pip_package $WORKSPACE/../tensorflow_pkg
mv $WORKSPACE/../tensorflow_pkg/sorflow-2.15.0-cp310-cp310-linux_aarch64.whl $WORKSPACE/../tensorflow_pkg/tensorflow-2.15.0-cp311-cp311-manylinux_2_17_aarch64.whl
pip install $WORKSPACE/../tensorflow_pkg/tensorflow*

cd ..

# 下载 text 源码
git clone https://github.com/tensorflow/text
cd text
git checkout 2.15
./oss_scripts/run_build.sh
pip install tensorflow_text-2.15.0-cp311-cp311-linux_aarch64.whl


end=$(date +%s)
Expand Down
53 changes: 53 additions & 0 deletions 24-07/tensorflow/shell/tf-riscv64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

set -e # 在遇到非零返回值时立即退出

start=$(date +%s)

# 安装 Python 和 TensorFlow 软件包依赖项
sudo dnf install python3-devel python3-pip -y
# 安装 bazel 软件包依赖项
sudo dnf install python zip unzip java-11-openjdk-devel -y
# 安装基本的工具
sudo dnf install patchelf -y

# 创建虚拟环境
python -m venv venv00
source venv00/bin/activate

# 安装 TensorFlow pip 软件包依赖项
pip install -U pip numpy wheel
pip install -U keras_preprocessing --no-deps

# 安装 bazel 6.1.0 , TensorFlow 需要
mkdir bazel-source; cd bazel-source
wget https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-dist.zip
unzip bazel-6.1.0-dist.zip
rm bazel-6.1.0-dist.zip
./compile.sh
./output/bazel

BAZEL=$(pwd)/output
PATH="$BAZEL:$PATH"
echo "# bazel" >> ~/.bashrc
echo "export BAZEL=$BAZEL" >> ~/.bashrc
echo "export PATH=$PATH" >> ~/.bashrc
source ~/.bashrc

cd ..

# 下载 TensorFlow 源码
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
git checkout tags/v2.15.0
./configure
# 创建软链接
sudo ln -s /usr/bin/aarch64-openEuler-linux-gcc /usr/bin/aarch64-linux-gnu-gcc
bazel build //tensorflow/tools/pip_package:build_pip_package --local_ram_resources=1024 --jobs=12
WORKSPACE=$(pwd)
./bazel-bin/tensorflow/tools/pip_package/build_pip_package $WORKSPACE/../tensorflow_pkg
pip install $WORKSPACE/../tensorflow_pkg/tensorflow*

end=$(date +%s)
runtime=$((end-start))
echo "脚本执行时长: $runtime s"
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# 24-07

[00 Caffe on Aarch64](24-07/caffe-aarch64.md)
[02 Caffe on RISC-V](24-07/caffe-riscv64.md)

[01 Tensorflow on Aarch64 (Full edition)](24-07/tensorflow-aarch64.md)

[02 Caffe on RISC-V](24-07/caffe-riscv64.md)
[00 Caffe on Aarch64](24-07/caffe-aarch64.md)

# 24-06

[00 Restricting CPU and Memory Usage](24-06/Restricting_CPU_and_Memory_Usage.md)

[01 Python-venv](24-06/python-venv.md)
[05 Tensorflow on Aarch64 (Express edition)](24-06/tensorflow_aarch64.md)

[02 What is nohup](24-06/what_is_nohup.md)
[04 How to save the output to a file](24-06/save_output_to_file.md)

[03 How to set linux system time](24-06/linux_time.md)

[04 How to save the output to a file](24-06/save_output_to_file.md)
[02 What is nohup](24-06/what_is_nohup.md)

[05 Tensorflow on Aarch64 (Express edition)](24-06/tensorflow_aarch64.md)
[01 Python-venv](24-06/python-venv.md)

[00 Restricting CPU and Memory Usage](24-06/Restricting_CPU_and_Memory_Usage.md)

0 comments on commit 83d7302

Please sign in to comment.