-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |