Skip to content

Commit a6b0c3f

Browse files
committed
tensorflow finish
1 parent b840ebb commit a6b0c3f

File tree

4 files changed

+112
-3
lines changed

4 files changed

+112
-3
lines changed

00-startup.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,27 @@ sudo systemctl enable force_pwm
116116

117117
## 2 从源码构建Tensorflow
118118

119-
obs环境搭建参考[这里](https://6eanut.github.io/NOTEBOOK/24-Q3/build-bazel-riscv.html),先构建[bazel](https://build.tarsier-infra.isrc.ac.cn/package/show/home:6eanut:branches:openEuler:24.03/bazel),后构建[tensorflow](https://build.tarsier-infra.isrc.ac.cn/package/show/home:6eanut:branches:home:Jingwiw:bazel/tensorflow)
119+
obs环境搭建参考[这里](https://6eanut.github.io/NOTEBOOK/24-Q3/build-bazel-riscv.html),先构建[bazel](https://build.tarsier-infra.isrc.ac.cn/package/show/home:6eanut:branches:openEuler:24.03/bazel),后构建[tensorflow](https://github.com/tensorflow/tensorflow.git),在tf构建前需要安装python3.9.6,并安装[requirements_1.txt](oerv-tf/requirements_1.txt),tf构建后安装[requirements_2.txt](oerv-tf/requirements_2.txt)
120120

121121
```shell
122-
# 构建并安装bazel
122+
# 构建并安装bazel5.3.0
123123
osc co home:6eanut:branches:openEuler:24.03/bazel
124124
cd home\:6eanut\:branches\:openEuler\:24.03/bazel/
125125
osc up -S
126126
rm -f _service;for file in `ls | grep -v .osc`;do new_file=${file##*:};mv $file $new_file;done
127127
osc build
128128
dnf install /var/tmp/build-root/mainline_riscv64-riscv64/home/abuild/rpmbuild/RPMS/riscv64/bazel-5.3.0-2.oe2403.riscv64.rpm -y
129+
130+
# 从源码构建tensorflow2.13.0
131+
git clone https://github.com/tensorflow/tensorflow.git
132+
cd tensorflow
133+
git checkout tags/v2.13.0
134+
# 将.bazelrc中的build --define=with_xla_support=true改为false,build:linux --define=build_with_onednn_v2=true改为false
135+
./configure
136+
bazel build //tensorflow/tools/pip_package:build_pip_package --define=build_with_mkl=false --define=enable_mkl=false --define=tensorflow_mkldnn_contraction_kernel=0 --define=build_with_mkl_dnn_v1_only=false --define=tensorflow_use_mkldnn=false --define=build_with_openmp=false
137+
WORKSPACE=$(pwd)
138+
./bazel-bin/tensorflow/tools/pip_package/build_pip_package $WORKSPACE/../tensorflow_pkg
139+
pip install $WORKSPACE/../tensorflow_pkg/tensorflow* --no-deps
129140
```
130141

131-
tensorflow的构建目前还有问题,等之后闲了再继续搞。
142+
![1745028230318](image/00-startup/1745028230318.png)

image/00-startup/1745028230318.png

73.9 KB
Loading

oerv-tf/requirements_1.txt

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Cython==3.0.12
2+
MarkupSafe==3.0.2
3+
Pillow==11.1.0
4+
absl-py==1.4.0
5+
astunparse==1.6.3
6+
bleach==6.2.0
7+
cachetools==5.5.2
8+
certifi==2025.1.31
9+
charset-normalizer==3.4.1
10+
click==8.1.8
11+
colorama==0.4.6
12+
contourpy==1.3.0
13+
cycler==0.12.1
14+
dm-tree==0.1.8
15+
etils==1.5.2
16+
flatbuffers==25.2.10
17+
fonttools==4.57.0
18+
fsspec==2025.3.2
19+
gast==0.4.0
20+
gin-config==0.5.0
21+
google-api-core==2.24.2
22+
google-api-python-client==2.166.0
23+
google-auth==2.38.0
24+
google-auth-httplib2==0.2.0
25+
google-auth-oauthlib==1.0.0
26+
google-pasta==0.2.0
27+
googleapis-common-protos==1.69.2
28+
grpcio==1.71.0
29+
h5py==3.13.0
30+
httplib2==0.22.0
31+
idna==3.10
32+
immutabledict==4.2.1
33+
importlib-metadata==8.6.1
34+
importlib-resources==6.5.2
35+
jaxlib==0.4.30
36+
kaggle==1.7.4.2
37+
keras==2.12.0
38+
kiwisolver==1.4.7
39+
libclang==18.1.1
40+
lxml==5.3.2 缺包
41+
markdown==3.7
42+
matplotlib==3.9.4
43+
ml-dtypes==0.5.1
44+
numpy==1.24.3
45+
oauth2client==4.1.3
46+
oauthlib==3.2.2
47+
opencv-python-headless==4.11.0.86
48+
opt-einsum==3.4.0
49+
packaging==24.2
50+
pandas==2.2.3
51+
portalocker==3.1.1
52+
promise==2.3
53+
proto-plus==1.26.1
54+
protobuf==4.21.12
55+
psutil==7.0.0
56+
py-cpuinfo==9.0.0
57+
pyasn1==0.6.1
58+
pyasn1-modules==0.4.2
59+
pycocotools==2.0.8
60+
pyparsing==3.2.3
61+
python-dateutil==2.9.0.post0
62+
python-slugify==8.0.4
63+
pytz==2025.2
64+
pyyaml==5.4.1
65+
regex==2024.11.6
66+
requests==2.32.3
67+
requests-oauthlib==2.0.0
68+
rsa==4.9
69+
sacrebleu==2.5.1
70+
scipy==1.13.1
71+
sentencepiece==0.2.0
72+
seqeval==0.0.10
73+
six==1.17.0
74+
tabulate==0.9.0
75+
termcolor==3.0.1
76+
text-unidecode==1.3
77+
toml==0.10.2
78+
tqdm==4.67.1
79+
typeguard==2.13.3
80+
typing-extensions==4.5.0
81+
tzdata==2025.2
82+
uritemplate==4.1.1
83+
urllib3==2.3.0
84+
webencodings==0.5.1
85+
werkzeug==3.1.3
86+
wheel==0.45.1
87+
wrapt==1.14.1
88+
zipp==3.21.0

oerv-tf/requirements_2.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
tensorboard==2.12.3
2+
tensorboard-data-server==0.7.2
3+
tensorflow-datasets==4.9.3
4+
tensorflow-metadata==1.17.1
5+
array-record==0.4.1
6+
tensorflow-estimator==2.12.0
7+
tensorflow-hub==0.16.1
8+
tf-keras==2.15.0
9+
tensorflow-model-optimization==0.8.0
10+
tf-slim==1.1.0

0 commit comments

Comments
 (0)