diff --git a/README.md b/README.md index dc12e98d1e7356bc75c24cbd50cd1d3865410126..d9912bf968daea84202a47fef1751720f6393668 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,9 @@ TensorFlow Adapter For Ascend(简称TF Adapter)致力于将昇腾AI处理器 ![tfadapter](https://images.gitee.com/uploads/images/2020/1027/094640_8f305b88_8175427.jpeg "framework.jpg") 您可以通过阅读[昇腾社区文档中心](https://www.hiascend.com/zh/document)的《TensorFlow 迁移与训练》手册获取更多使用细节。 +a. 完成gcc、python等依赖的安装。 +b. 完成开发套件包Ascend-cann-toolkit*_{version}*_linux-*{arch}*.run的安装。 ## 源码安装 您可以通过此仓中的源代码构建TF Adapter软件包并将其部署在昇腾AI处理器所在环境上。 @@ -51,7 +53,7 @@ TensorFlow Adapter For Ascend(简称TF Adapter)致力于将昇腾AI处理器 可执行如下命令进行SWIG(http://www.swig.org/download.html))的安装: `pip3 install swig` - +在部分场景下,您可能会把自己定制或者修改过的TensorFlow与TF Adapter软件包配合使用,由于TF Adapter默认链接的是TensorFlow官方网站的源码,因此您在使用TF Adapter软件包的时候,可能会因为符号不匹配而出现coredump问题。为了使TF Adapter能适配您的TensorFlow源码,您需要将TF Adapter源码下的tensorflow/cmake/tensorflow.cmake文件稍作修改,详细修改点如下: ### TF Adapter源码下载 ``` @@ -87,6 +89,8 @@ chmod +x build.sh ./build/tfadapter/dist/python/dist/npu_bridge-1.15.0-py3-none-any.whl ``` +执行完成后,TF Adapter相关文件安装到python解释器搜索路径下,例如“/usr/local/python3.7.5/lib/python3.7/siite-packages”路径,安装后文件夹为“npu_bridge”与“npu_bridge-1.15.0.dist-info”。 + ### 安装TF Adapter 执行如下命令安装TF Adapter。 ``` @@ -98,21 +102,21 @@ pip3 install ./build/tfadapter/dist/python/dist/npu_bridge-1.15.0-py3-none-any.w 欢迎参与贡献。 ## 社区版本规划 -https://gitee.com/ascend/tensorflow/wikis/Home?sort_id=3076366 +https://gitee.com/ascend/tensorflow/wikis/Home?sort_id=3076366hhh ## Release Notes -Release Notes请参考[RELEASE](RELEASE.md). +Release Notes请参考[RELEASE](RELEASE.md).00 ## FAQ -#### 1. 执行./build.sh时提示配置swig的路径 -需要执行以下命令安装swig +#### 1. 执行./build.sh时提示配置swig的路径11 +需要执行以下命令安装swig22 ``` -pip3 install swig +pip3 install swig33 ``` -#### 2. Ubuntu系统中执行./build.sh时提示“Could not import the lzma module” +#### 2. Ubuntu系统中执行./build.sh时提示“Could not import the lzma4 module” -​ 执行如下命令进行lzma的安装: +​ 执行如下命令进行lzma的安装:55 ​ `apt-get install liblzma-dev` diff --git a/configure.py b/configure.py index c3ad92945919ef9495f4d10b67e7e2ca7e4e3684..7ba6b96f52fce4cc90c92743528c959c0169a94f 100755 --- a/configure.py +++ b/configure.py @@ -28,6 +28,16 @@ try: from shutil import which except ImportError: from distutils.spawn import find_executable as which +# 新增注释1 +# 新增注释2 +# 新增注释3 +# 新增注释4 +# 新增注释5 +# 新增注释6 +# 新增注释7 +# 新增注释8 +# 新增注释9 +# 新增注释10 _COMPAT_TENSORFLOW_VERSION = "1.15.0" _COMPAT_PYTHON_VERSION = "Python 3.7" @@ -57,23 +67,31 @@ def get_input(question): def real_config_path(file): """Get complete file path""" return os.path.join("tools", file) - +# 新增注释11 +# 新增注释12 +# 新增注释13 +# 新增注释14 +# 新增注释15 +# 新增注释16 +# 新增注释17 +# 新增注释18 +# 新增注释19 def setup_python(): - """Get python install path.""" - default_python_bin_path = which('python3.7') - custom_python_bin_path = '' - ask_python_bin_path = '' - if default_python_bin_path: - custom_python_bin_path = default_python_bin_path - compile_args = run_command([ - custom_python_bin_path, '--version']) + """Get python install pat0h.""" + default_python_bin_path0 = which('python3.7') + custom_python_bin_path0 = '' + ask_python_bin_path0 = '' + if default_python_bin_path0: + custom_python_bin_path0 = default_python_bin_path + compile_args = run_command0([ + custom_python_bin_path0, '--version']) if _COMPAT_PYTHON_VERSION not in compile_args: print('Invalid default python version: %s, only support Python 3.7.' % compile_args) - ask_python_bin_path = ('Please specify the location of python with valid ' + ask_python_bin_path0 = ('Please specify the location of python with valid ' 'tensorflow 1.15.0 site-packages installed. [Default ' 'is %s]\n(Please enter the correct python path: ') % default_python_bin_path - custom_python_bin_path = '' + custom_python_bin_path0 = '' else: ask_python_bin_path = ('Please specify the location of python with valid ' 'tensorflow 1.15.0 site-packages installed. [Default ' @@ -90,12 +108,6 @@ def setup_python(): # Check if the path is valid if os.path.isfile(python_bin_path) and os.access(python_bin_path, os.X_OK): pass - elif not os.path.exists(python_bin_path): - print('Invalid python path: %s cannot be found.' % python_bin_path) - continue - else: - print('%s is not executable. Is it the python binary?' % python_bin_path) - continue try: compile_args = run_command([