DeepRec编译生成whl包

简介: DeepRec编译生成whl包

ECS 使用Ubuntu 20.04系统

安装docker

apt update
apt install docker.io -y

拉取镜像

docker pull alideeprec/deeprec-tianchi:deeprec-cpu-py36-ubuntu18.04
deeprec-cpu-py36-ubuntu18.04: Pulling from alideeprec/deeprec-tianchi
171857c49d0f: Pull complete 
419640447d26: Pull complete 
61e52f862619: Pull complete 
d9e2325ed518: Pull complete 
3181a77c167e: Pull complete 
4d90b1065554: Pull complete 
6f645ab01471: Pull complete 
caf5cc9788dc: Pull complete 
18425f078e83: Pull complete 
2ff8095e796c: Pull complete 
6673f27730f3: Pull complete 
aaf6201115e6: Pull complete 
da571ade1cfe: Pull complete 
387146fbd3ee: Pull complete 
e56823d3e32f: Pull complete 
3ffae41a9164: Pull complete 
18cb5b9d0b83: Downloading  1.448GB/5.785GB
d6adfdb806f3: Download complete 
a5db3e1b51b4: Downloading  903.2MB/1.565GB

拉取完成

d6adfdb806f3: Pull complete 
a5db3e1b51b4: Pull complete 
Digest: sha256:193dbdcc72e72578ce774d97049eb4f016bb79735ffaec08f4ed5ed9b8433b97
Status: Downloaded newer image for alideeprec/deeprec-tianchi:deeprec-cpu-py36-ubuntu18.04
docker.io/alideeprec/deeprec-tianchi:deeprec-cpu-py36-ubuntu18.04

运行镜像启动bash

sudo docker run -ti --name=tianchi_test --net=host -v /code/:/code alideeprec/deeprec-tianchi:deeprec-cpu-py36-ubuntu18.04 bash

查看/tianchi目录

ls /tianchi/
data  models

获取DeepRec代码,也可以在使用docker pull前执行

cd /code
git clone https://github.com/alibaba/DeepRec
Cloning into 'DeepRec'...
remote: Enumerating objects: 678325, done.
remote: Counting objects: 100% (465/465), done.
remote: Compressing objects: 100% (292/292), done.
Receiving objects:  16% (112984/678325), 107.69 MiB | 11.86 MiB/s

编译配置使用默认选项

./configure 
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.26.1 installed.
Do you wish to build TensorFlow with XLA JIT support? [Y/n]: 
XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with STAR support? [Y/n]: 
STAR support will be enabled for TensorFlow.

Do you wish to build TensorFlow with PMEM support? [y/N]: 
No PMEM support will be enabled for TensorFlow.

Do you wish to build TensorFlow with GPU_EV support? [y/N]: 
No GPU_EV support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Parquet Dataset support? [Y/n]: 
Parquet Dataset support will be enabled for TensorFlow.

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: 
No OpenCL SYCL support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: 
No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with MPI support? [y/N]: 
No MPI support will be enabled for TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]: 


Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
        --config=mkl_threadpool # Build with oneDNN support.
        --config=monolithic     # Config for mostly static monolithic build.
        --config=gdr            # Build with GDR support.
        --config=verbs          # Build with libverbs support.
        --config=ngraph         # Build with Intel nGraph support.
        --config=numa           # Build with NUMA support.
        --config=dynamic_kernels        # (Experimental) Build kernels into separate shared objects.
        --config=v2             # Build TensorFlow 2.x instead of 1.x.
Preconfigured Bazel build configs to DISABLE default on features:
        --config=noaws          # Disable AWS S3 filesystem support.
        --config=nogcp          # Disable GCP support.
        --config=nohdfs         # Disable HDFS support.
        --config=noignite       # Disable Apache Ignite support.
        --config=nokafka        # Disable Apache Kafka support.
        --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished

编译

bazel build  -c opt --config=opt  --config=mkl_threadpool --define build_with_mkl_dnn_v1_only=true //tensorflow/tools/pip_package:build_pip_package
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=106
INFO: Reading rc options for 'build' from /code/DeepRec/.bazelrc:
  'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --copt=-w --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --config=v1
INFO: Reading rc options for 'build' from /code/DeepRec/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/home/pai/bin/python --action_env PYTHON_LIB_PATH=/home/pai/lib/python3.6/site-packages --python_path=/home/pai/bin/python --config=xla --config=star --config=parquet_dataset --action_env TF_USE_CCACHE=0 --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:v1 in file /code/DeepRec/.bazelrc: --define=tf_api_version=1 --action_env=TF2_BEHAVIOR=0
INFO: Found applicable config definition build:xla in file /code/DeepRec/.bazelrc: --action_env=TF_ENABLE_XLA=1 --define=with_xla_support=true
INFO: Found applicable config definition build:xla in file /code/DeepRec/.tf_configure.bazelrc: --define with_xla_support=true
INFO: Found applicable config definition build:star in file /code/DeepRec/.tf_configure.bazelrc: --define with_star_support=true
INFO: Found applicable config definition build:parquet_dataset in file /code/DeepRec/.tf_configure.bazelrc: --define with_parquet_dataset_support=true
INFO: Found applicable config definition build:opt in file /code/DeepRec/.tf_configure.bazelrc: --copt=-march=native --copt=-Wno-sign-compare --host_copt=-march=native --define with_default_optimizations=true
INFO: Found applicable config definition build:mkl_threadpool in file /code/DeepRec/.bazelrc: --define=build_with_mkl=true --define=enable_mkl=true --define=tensorflow_dnnl_contraction_kernel=0 --define=build_with_mkl_opensource=true --define=build_with_mkldnn_threadpool=true -c opt
Loading: 0 packages loaded
    Fetching @build_bazel_rules_swift; fetching 15s

2022-10-02-13-15-59.png

生成whl包并安装

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

pip install /tmp/tensorflow_pkg/tensorflow-1.15.5+deeprec2208-cp36-cp36m-linux_x86_64.whl 
目录
相关文章
|
虚拟化
vmware克隆虚拟机后没有ip地址的问题
解决vmware克隆虚拟机后没有内网ip的问题
1306 0
|
存储 数据采集 人工智能
如何设计一个监控平台(上篇)
在大型分布式微服务场景下,各个服务版本快速迭代,各类业务规模不断膨胀,同时监控的场景也在不断的发生变化,线上故障随时可能发生,各个平台错综复杂,如何保证线上服务稳定运行,同时提升运维效率,降低运维成本成了监控平台的挑战。
如何设计一个监控平台(上篇)
|
网络安全 数据安全/隐私保护 Windows
分享5款小众且无广告的小工具
推荐5款小众无广告软件:Krita(绘图)、WinSCP(文件传输)、燃精灵(微信检测)、GIDOT TYPESETTER(排版)、Sketchable(手绘笔记),功能强大且专注,提升创作与工作效率。
690 0
|
12月前
|
人工智能 边缘计算 自然语言处理
魔珐星云:免费体验企业级3D AI数字人智能客服!告别枯燥对话框!
魔珐科技携手魔搭社区上线「魔珐星云智能客服Demo」,基于超写实3D数字人技术,打造具身智能交互新体验。通过文生多模态3D大模型,实现语音、表情、动作实时生成,支持Web端低延时互动,百元级芯片即可运行,助力企业构建自然高效的人机对话系统。
1244 4
魔珐星云:免费体验企业级3D AI数字人智能客服!告别枯燥对话框!
|
12月前
|
存储 关系型数据库 数据库
【赵渝强老师】国产金仓数据库的体系架构
金仓数据库(KingbaseES)是基于PostgreSQL开发的国产关系型数据库,具有自主知识产权。其体系结构涵盖逻辑存储、物理存储、进程与内存管理,支持高可靠性与性能优化,广泛应用于关键信息基础设施领域。
1522 1
|
网络协议 算法 网络性能优化
【流媒体】推流与拉流简介
【流媒体】推流与拉流简介
3192 0
|
数据采集 存储 监控
网站价格监控:动态价格数据的实时抓取案例
本案例展示了如何利用爬虫技术实时抓取京东等电商平台的商品信息、价格及用户评价,通过代理IP、Cookie和User-Agent确保数据稳定采集。关键数据分析包括价格动态监控、评价趋势分析和竞争情报获取,助力商家制定策略。代码从简单请求逐步演进为具备异常处理、数据解析等功能的完整体系,并设计了「技术关系图谱」,直观展示系统模块间的关系,为开发者提供全局视角和技术路径参考。
2493 0
网站价格监控:动态价格数据的实时抓取案例
|
存储 人工智能 安全
AI时代,存力 or 算力 哪个更重要
本文探讨了AI技术发展中算力与存力的重要性。算力指计算能力,对处理大数据和实时计算至关重要;存力则是数据存储能力,确保数据安全可靠,支持后续分析。两者相辅相成,共同推动AI技术的快速发展,缺一不可。
|
人工智能 自然语言处理 BI
基于阿里云人工智能平台的智能客服系统开发与部署
随着人工智能技术的发展,智能客服系统成为企业提升服务效率和用户体验的重要工具。阿里云提供包括自然语言处理(NLP)、语音识别(ASR)、机器学习(PAI)等在内的完整AI平台,助力企业快速构建智能客服系统。本文将通过电商平台案例,展示如何基于阿里云AI平台从零开始开发、部署智能客服系统,并介绍其核心优势与最佳实践,涵盖文本和语音客服、知识库管理及数据分析等功能,显著提升客户服务效率和用户满意度。