• [技术干货] 推理时,利用numpy对数据进行预处理需要注意的地方
    想要在Atlas200DK上部署一个STGCN网络进行动作识别,测试数据是由txt保存的点集,所以用numpy进行读取和预处理。但是推理结果一直不对,找了很久原因终于发现:由于np的transpose和reshape等操作不改变内存中数据的实际分布,而使用ACL进行推理时是连续的读取内存,因此这些预处理操作对ACL来说是透明的!所以必须在预处理结束后进行一次深拷贝,才能把数据按照想要的格式输入到网络中进行推理。
  • [问题求助] 【Atlas 200DK】【运行环境搭建】在开发板安装numpy出现报错
    【功能模块】硬件开发板【操作步骤&问题现象】1、系统为18.04Ubuntu系统,开发板环境为18.04arm系统,采用了V2.0.0版本的开发者套件2、为了给开发板安装Python3的hiai库,参照https://gitee.com/Atlas200DK/sample-README/tree/master/DK_Environment#li81699892817进行了环境的配置,安装到最后一个numpy库时出现了报错,文字抄录如下【截图信息】root@davinci-mini:/home/HwHiAiUser# bash python3_hiai_install.shlack python install toolroot@davinci-mini:/home/HwHiAiUser# pip3 install numpyCollecting numpy  Using cached https://files.pythonhosted.org/packages/c5/63/a48648ebc57711348420670bb074998f79828291f68aebfff1642be212ec/numpy-1.19.4.zipBuilding wheels for collected packages: numpy  Running setup.py bdist_wheel for numpy ... error  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ksjukx08/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmppy0y087zpip-wheel- --python-tag cp36:  Running from numpy source directory.  Cythonizing sources  Processing numpy/random/_bounded_integers.pxd.in  Processing numpy/random/_sfc64.pyx  Traceback (most recent call last):    File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 59, in process_pyx      from Cython.Compiler.Version import version as cython_version  ModuleNotFoundError: No module named 'Cython'    During handling of the above exception, another exception occurred:    Traceback (most recent call last):    File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 235, in <module>      main()    File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 231, in main      find_process_files(root_dir)    File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 222, in find_process_files      process(root_dir, fromfile, tofile, function, hash_db)    File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 188, in process      processor_function(fromfile, tofile)    File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 64, in process_pyx      raise OSError('Cython needs to be installed in Python as a module')  OSError: Cython needs to be installed in Python as a module  Traceback (most recent call last):    File "<string>", line 1, in <module>    File "/tmp/pip-build-ksjukx08/numpy/setup.py", line 508, in <module>      setup_package()    File "/tmp/pip-build-ksjukx08/numpy/setup.py", line 488, in setup_package      generate_cython()    File "/tmp/pip-build-ksjukx08/numpy/setup.py", line 285, in generate_cython      raise RuntimeError("Running cythonize failed!")  RuntimeError: Running cythonize failed!    ----------------------------------------  Failed building wheel for numpy  Running setup.py clean for numpy  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ksjukx08/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:  Running from numpy source directory.    `setup.py clean` is not supported, use one of the following instead:      - `git clean -xdf` (cleans all files)    - `git clean -Xdf` (cleans all versioned files, doesn't touch                        files that aren't checked into the git repo)    Add `--force` to your command to use it anyway if you must (unsupported).      ----------------------------------------  Failed cleaning build dir for numpyFailed to build numpyInstalling collected packages: numpy  Running setup.py install for numpy ... error    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ksjukx08/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-l_x8n93u-record/install-record.txt --single-version-externally-managed --compile:    Running from numpy source directory.        Note: if you need reliable uninstall behavior, then install    with pip instead of using `setup.py install`:          - `pip install .`       (from a git repo or downloaded source                               release)      - `pip install numpy`   (last NumPy release on PyPi)            Cythonizing sources    numpy/random/_bounded_integers.pxd.in has not changed    Processing numpy/random/_sfc64.pyx    Traceback (most recent call last):      File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 59, in process_pyx        from Cython.Compiler.Version import version as cython_version    ModuleNotFoundError: No module named 'Cython'        During handling of the above exception, another exception occurred:        Traceback (most recent call last):      File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 235, in <module>        main()      File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 231, in main        find_process_files(root_dir)      File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 222, in find_process_files        process(root_dir, fromfile, tofile, function, hash_db)      File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 188, in process        processor_function(fromfile, tofile)      File "/tmp/pip-build-ksjukx08/numpy/tools/cythonize.py", line 64, in process_pyx        raise OSError('Cython needs to be installed in Python as a module')    OSError: Cython needs to be installed in Python as a module    Traceback (most recent call last):      File "<string>", line 1, in <module>      File "/tmp/pip-build-ksjukx08/numpy/setup.py", line 508, in <module>        setup_package()      File "/tmp/pip-build-ksjukx08/numpy/setup.py", line 488, in setup_package        generate_cython()      File "/tmp/pip-build-ksjukx08/numpy/setup.py", line 285, in generate_cython        raise RuntimeError("Running cythonize failed!")    RuntimeError: Running cythonize failed!        ----------------------------------------Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ksjukx08/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-l_x8n93u-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ksjukx08/numpy/【日志信息】(可选,上传日志内容或者附件)
  • [技术干货] 【Atlas200DK】【Atlas300】【opencv】fatal error:numpy/ndarrayobject.h
    问题描述源码编译安装opencv时,在cmake里加了python相关的参数,可以同时编出供python使用的opencv,即import cv2 ,python的opencv依赖numpy。但在make的时候出现如下错误,fatal error:numpy/ndarrayobject.h :No such file or directory可能原因系统中存在多个版本的numpy,存在冲突,make时链接不到正确的numpy。解决方案root  用户下查找下ndarrayobject.h文件find / -name ndarrayobject.h找到后,修改报错的cpp文件,将报错的include 换成绝对路径即可。修改方式如下图,修改好后,重新make 即可。
  • 鲲鹏arm 安装 numpy opencv opencv_contrib
    1,前置条件yum install numpy opencv* python-devel gstreamer-plugins-base-devel libv4l-devel libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel python-sphinx texlive python3-devel python3.aarch64 -y python3 -m pip install cython yum install blas-devel lapack-devel python3-devel pip3 install scipy     //会自动安装依赖numpy,本次采用官方源,未使用镜像源加速,安装过程很漫长,因为会自动编译安装  2,安装cmake,参考下边链接http://ic-openlabs.huawei.com/openlab/#/knowledgebasequery?task_id=R1S1584D002187178201911251854493362566973,下载opencv和opencv_contrib,两者版本必须一致,3.2.0测试编译成功,高版本可能失败wget    https://github.com/opencv/opencv/archive/3.2.0.zip wget  https://github.com/opencv/opencv_contrib/archive/3.2.0.zip4,解压,编译unzip 3.2.0.zip unzip 3.2.0.zip.1 cd opencv mkdir -p build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_opencv_python3=YES -D BUILD_opencv_python2=NO -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib64/python3.6/site-packages/numpy/core/include/ -D OPENCV_EXTRA_MODULES=../../opencv_contrib-3.2.0/modules/ -D  PYTHON3_LIBRARIES=/lib64/libpython3.so -D PYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -D __INSTALL_PATH_PYTHON3=/usr/local/lib/python3.6/site-packages/ ..5,安装make -j$(nproc) make install6,验证
  • [问题求助] 【实战营提问】numpy.ufunc has the wrong size,怎么解决,试了两次步骤都没错(AI实战第3章)
  • 请问鲲鹏上numpy等矩阵计算库的计算效率怎么样
    请问鲲鹏上numpy等矩阵计算库的计算效率怎么样
  • [问题求助] 输入开发板运行命令后一直提示no module named numpy
    如图,我在运行自己的模型时,一直提示没有numpy,可进入python环境下from numpy import*并没有问题呀,请问这是哪里出错了呢?
  • [大赛专区] 赛道一python分享(赛道一)
    用Python实现,总共大约300行。还是很简单的,新手,没有花里胡哨的用法。global是全局变量,为了函数内能改变它的值。导入numpy会增加200ms左右的时间,全篇没有用numpy。不然numpy的结构化数组挺好用的。这里定义了很多变量。首先:while true循环接受输入,控制前6个输入部署状态。ta = 0  tihuon = 100 label = {'s': 0, 'r1': 0, 'r2': 0, 'r3': 0, 'r4': 0, 'r5': 0} #s是仓库坐标,r1-r5是小区坐标 need = {'r1': 0, 'r2': 0, 'r3': 0, 'r4': 0, 'r5': 0}#需求数量 give = {}#捐赠小区 give_ = {}#捐赠数量 distance = {'r1': 0, 'r2': 0, 'r3': 0, 'r4': 0, 'r5': 0} #计算当前位置与仓库距离 distancegi = {'r1': 0, 'r2': 0, 'r3': 0, 'r4': 0, 'r5': 0} #中间变量,为了排序 distance_give = {} #捐赠小区与需求小区之间距离 now = [0, 0]#目前的走向 now_go = None #目的地 shave = 100 #目前有的口罩数 flag = True #是否重新规划路线 cangku = [] #仓库坐标 flag_back = True #是否取货 step = 0 flag_give = False #是否取捐赠小区取货 edu=51 #额度,低于这个值就要取货 edu1=0 #另一个额度,目前没用到 edugive=0 #额度,如果捐赠小区的数量+edgive大于某值,就去取货while True:     step += 1     inputs = input()     inputs = inputs.strip().split()          if step <= 6:         if step == 1:             label['s'] = [int(inputs[1]), int(inputs[2])]             cangku = [int(inputs[1]), int(inputs[2])]             continue                      if step == 2:             label['r1'] = [int(inputs[1]), int(inputs[2])]             need['r1'] = int(inputs[3])             continue                      if step == 3:             label['r2'] = [int(inputs[1]), int(inputs[2])]             need['r2'] = int(inputs[3])             continue                      if step == 4:             label['r3'] = [int(inputs[1]), int(inputs[2])]             need['r3'] = int(inputs[3])             continue                      if step == 5:             label['r4'] = [int(inputs[1]), int(inputs[2])]             need['r4'] = int(inputs[3])             continue                      if step == 6:             label['r5'] = [int(inputs[1]), int(inputs[2])]             need['r5'] = int(inputs[3])             continue如果输入是Gif inputs == ['G']:        如果目前的口罩书小于额度,就取货。              if shave<edu:     if flag_back == True: #判断是否规划路线         caculate_give_distance() #计算当前点与各个捐赠点的距离         now_go_give, now_give = get_near_give() #获取目的地,路径。[2,2]代表需要向南,东,各2步。         now_to_cangku = [cangku[0] - label['s'][0], cangku[1] - label['s'][1]] #目前去仓库的路径         if now_go_give != None and ((abs(now_give[0]) + abs(now_give[1])) < (abs(now_to_cangku[0]) + abs(now_to_cangku[1]))) and any(             [abs(v) for k, v in need.items() if abs(v) <= (give[now_go_give][2])+edugive]):#如果去捐赠小区拿货比取仓库拿货近,而且能拿够指定数量(大于需求量的最小值)             now = now_give #去捐赠小区             now_go = now_go_give             flag_back = False             flag_give = True         else:             now = [cangku[0] - label['s'][0], cangku[1] - label['s'][1]] #否则就去仓库             now_go = 's'             flag_back = False     a = random.randint(1, 2) #先东西方向走还是南北走,1就先南北,后东西,随机走,万一碰到捐赠,不经意取到货     if a == 1:         if now[0] < 0:             print('N')             label['s'][0] -= 1             now[0] += 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue         if now[0] > 0:             print('S')             label['s'][0] += 1             now[0] -= 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue         if now[1] > 0:             print('E')             label['s'][1] += 1             now[1] -= 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue         if now[1] < 0:             print('W')             label['s'][1] -= 1             now[1] += 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue     if a == 2:         if now[1] > 0:             print('E')             label['s'][1] += 1             now[1] -= 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue         if now[1] < 0:             print('W')             label['s'][1] -= 1             now[1] += 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue         if now[0] < 0:             print('N')             label['s'][0] -= 1             now[0] += 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue         if now[0] > 0:             print('S')             label['s'][0] += 1             now[0] -= 1             zt_change()             xiehuo()             if len(need) == 0:                 break             continue def caculate_give_distance():     global distance_give     distance_give = {}     for i in give:         distance_give = abs(give[0] - label['s'][0]) + abs(give[1] - label['s'][1])         if distance_give==0:             distance_give=100 def get_near_give():     near_label = (sorted(distance_give, key=distance_give.get))     now_go = None     now = None     for i in near_label:         if give[2] != 0:             now_go = i             now = [give[0] - label['s'][0], give[1] - label['s'][1]]             break         else:             continue     return now_go, now否则就配送    elif shave != 0:         if flag == True:    #规划配送路线             caculate_distance()             now_go, now = get_near()                  flag = False         a=random.randint(1,2)         if a ==1:             if now[0] < 0:                 print('N')                 label['s'][0] -= 1                 now[0] += 1                 zt_change()                 xiehuo()                      if len(need)==0:                     break                 continue             if now[0] > 0:                 print('S')                 label['s'][0] += 1                 now[0] -= 1                 zt_change()                 xiehuo()                 if len(need)==0:                     break                 continue             if now[1] > 0:                 print('E')                 label['s'][1] += 1                 now[1] -= 1                 zt_change()                 xiehuo()                 if len(need)==0:                     break                 continue             if now[1] < 0:                 print('W')                 label['s'][1] -= 1                 now[1] += 1                 zt_change()                 xiehuo()                 if len(need)==0:                     break                 continue         if a==2:                  if now[1] > 0:                 print('E')                 label['s'][1] += 1                 now[1] -= 1                 zt_change()                 xiehuo()                 if len(need) == 0:                     break                 continue             if now[1] < 0:                 print('W')                 label['s'][1] -= 1                 now[1] += 1                 zt_change()                 xiehuo()                 if len(need) == 0:                     break                 continue             if now[0] < 0:                 print('N')                 label['s'][0] -= 1                 now[0] += 1                 zt_change()                 xiehuo()                      if len(need) == 0:                     break                 continue             if now[0] > 0:                 print('S')                 label['s'][0] += 1                 now[0] -= 1                 zt_change()                 xiehuo()                 if len(need) == 0:                     break                 continue def caculate_distance():     for i in distance:         distance = abs(label['s'][0] - label[0]) + abs(label['s'][1] - label[1]) def get_near():     near_label = (sorted(distance, key=distance.get))     now_go = None     now = None     for i in range(5):         if need[near_label] != 0:             now_go = near_label            now = [label[now_go][0] - label['s'][0], label[now_go][1] - label['s'][1]]             break         else:             continue     return now_go, now如果输入捐赠小区,处理give有关字典。并更新当前状态(万一捐赠小区与当前位置重合)if inputs[0] == 'R':     if ''.join(inputs) in give_.keys():         give[''.join(inputs)][2] += int(inputs[3])     else:         give[''.join(inputs)] = ([int(inputs[1]), int(inputs[2]), int(inputs[3])])         give_[''.join(inputs)] = [int(inputs[1]), int(inputs[2])]     zt_change()     continue更新状态的函数def zt_change():     global now, now_go, exchang, shave, flag_back, flag, need, ta     if [label['s'][0], label['s'][1]] == cangku:#经过仓库         shave = 100     if ([label['s'][0], label['s'][1]] in give_.values()):#经过捐赠小区         key = get_key1(give_, [label['s'][0], label['s'][1]])         exchan = give[key[0]][2]         shave += exchan         if shave > 100:             a = shave             shave = 100             give[key[0]][2] = a - 100         else:             give[key[0]][2] = 0             give_.pop(key[0])             give.pop(key[0])     if ([label['s'][0], label['s'][1]] in list(label.values())[1:]):#经过需求小区         l = {key: value for key, value in label.items() if key in ['r1', 'r2', 'r3', 'r4', 'r5']}         key = get_key1(l, [label['s'][0], label['s'][1]])         exchang = need[key[0]]         need[key[0]] += shave         if need[key[0]] < 0:             shave = 0         if need[key[0]] >= 0:             shave = need[key[0]]             need[key[0]] = 0         if now[0] == 0 and now[1] == 0:             ta += need[key[0]] - exchang             flag = True         if need[key[0]] == 0:             need.pop(key[0])             distance.pop(key[0])             distancegi.pop(key[0])             label.pop(key[0])     if shave<edu:         flag_back = True其它函数def caculate_dis_return_need(x, y):     a = 0     for i in distancegi:         distancegi = (abs(x - label[0]) + abs(y - label[1]))     near = (sorted(distancegi, key=distancegi.get))     for i in range(5):         if need[near] != 0:             a = need[near]             break         else:             continue     return abs(a) def get_key1(dct, value): #根据字典值获取键     return list(filter(lambda k: dct[k] == value, dct)) def xiehuo(): #到达目的地需要重新规划路径     global now, now_go, exchang, shave, flag_back, flag, need     if now[0] == 0 and now[1] == 0:         flag = True
  • [问题求助] MIND STUDIO 2.1 DDK 1.32,TBE算子编译失败.NUMPY没找到.
    编译:Information:MyOperator_tbe Reduction Rebuild Start/home/atlas/AscendProjects/MyOperator_tbeInformation:Build OperatorInformation:Traceback (most recent call last):Information:    from topi.cce import te_set_versionInformation:    from te.tvm._ffi.libinfo import __version__Information:    import tvmInformation:    from . import tensorInformation:    from ._ffi.node import NodeBase, NodeGeneric, register_node, convert_to_nodeInformation:    from .node_generic import NodeGeneric, convert_to_node, constInformation:    from .base import string_typesInformation:    import numpy as npError:ModuleNotFoundError: No module named 'numpy'命令查看是否有NUMPY库Python 2.7.12 (default, Apr 15 2020, 17:07:12)[GCC 5.4.0 20160609] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import numpy>>>>>>>>> import numpy as npatlas@yangch-Latitude-3400:~/picasso/BJSRX/src/picasso_sdk$ ls /usr/lib/python2.7/dist-packages/numpyadd_newdocs.py   ctypeslib.pyc     _import_tools.pyc  matlib.pyc  testsadd_newdocs.pyc  distutils         __init__.py        matrixlib   version.pycompat           dual.py           __init__.pyc       polynomial  version.pyc__config__.py    dual.pyc          lib                random__config__.pyc   f2py              linalg             setup.pycore             fft               ma                 setup.pycctypeslib.py     _import_tools.py  matlib.py          testingPYTHON TBE依赖配置:
  • [交流分享] CentOS安装python numpy和scipy
    1. 安装Cython     python3 -m pip install cython2. 安装blas-devel lapack-devel python3-devel  yum install blas-devel lapack-devel python3-devel3. 安装numpy  https://pypi.org/下可以查询到当前没有arm版本,执行python3 -m pip install numpy会自动下载源码编译,但编译过程会出现如下段错误     numpy/core/src/npymath/npy_math_internal.h.src: In function 'npy_cacoshf':      numpy/core/src/npymath/npy_math_internal.h.src:482:12: internal compiler error: Segmentation fault       return @kind@@c@(x, y);  从https://pypi.org/project/numpy/#files上下载最新源码编译安装        1. wget https://files.pythonhosted.org/packages/84/1e/ff467ac56bfeaea51d4a2e72d315c1fe440b20192fea7e460f0f248acac8/numpy-1.18.2.zip         2. unzip numpy-1.18.2.zip         3. 根据https://github.com/numpy/numpy/issues/13622上的建议,修改npy_math_internal.h.src文件             --- numpy/core/src/npymath/npy_math_internal.h.src.orig 2019-11-14 12:20:01.387180922 +0000                     +++ numpy/core/src/npymath/npy_math_internal.h.src 2019-11-14 12:19:17.960646234 +0000             @@ -477,7 +477,7 @@               * #KIND = ATAN2,HYPOT,POW,FMOD,COPYSIGN#               */              #ifdef HAVE_@KIND@@C@             -NPY_INPLACE @type@ npy_@kind@@c@(@type@ x, @type@ y)             +NPY_INPLACE __attribute__((optimize("-O0"))) @type@ npy_@kind@@c@(@type@ x, @type@ y)              {                  return @kind@@c@(x, y);              }          4. cd numpy-1.18.2/          5. python3 setup.py build          6. python3 setup.py install -O1 --skip-build --root /tmp/test_numpy          7. pip list可以查看安装成功4. 安装scipy    python3 -m pip install scipy    pip list确认安装成功
  • [问题求助] 算子开发 (Tensor / 255. - mean)/ std
    import numpy as np input_shape = (1, 3, 20, 15) input_arr = np.random.randint(0, 254, (1, 3, 20, 15), np.uint8) image_mean = np.array([0.485, 0.456, 0.406]) image_std = np.array([0.229, 0.224, 0.225]) input_arr = input_arr.astype(np.float32) / 255. output_arr = (input_arr - image_mean.reshape(1, 3, 1, 1)) / image_std.reshape(1, 3, 1, 1)上面这段逻辑是用 numpy 实现的逻辑。如何在利用自定义算子 实现上述逻辑 ?下面是我实现的算子部分代码。 vsub 要求两个两个 tensor 必须完全一样。    shape = list(shape)     inp_dtype = dtype.lower()     # define input     data = tvm.placeholder(shape, name="data_input", dtype=inp_dtype)     # computational process     image_mean = np.array([0.485, 0.456, 0.406])     image_std = 1 / np.array([0.229, 0.224, 0.225])     mean = tvm.nd.array(image_mean.reshape(1,3,1,1))     std = tvm.nd.array(image_std.reshape(1,3,1,1))     with tvm.target.cce():                res = te.lang.cce.vmuls(data, 0.003921568627451)         res = te.lang.cce.vsub(res, mean)         res = te.lang.cce.vmul(res, std)         sch = generic.auto_schedule(res)     config = {"print_ir": need_print,               "need_build": need_build,               "name": kernel_name,               "tensor_list": [data, res]}     te.lang.cce.cce_build_code(sch, config)除了自定义算子之外,是否有其他的途径利用加速芯片实现用 numpy 实现的逻辑?召唤大佬
  • python3.7.4 组件编译安装numpy scipy scikit_learn mlflow(Centos7.6)
      编译环境 python:3.7.4 OS:centos7.6 组件:numpy scipy、scikit_learn、mlflow 编译安装 numpy-1.17.0wget https://github.com/numpy/numpy/archive/v1.17.0.zipwget https://files.pythonhosted.org/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip 解压缩cd numpy-1.17.0export CFLAGS="-O0"   python3.7 setup.py install或者python install . 在线安装pip install numpy==1.17.0pip3 install numpy==1.17.0如果失败请加上如下编译选项export CFLAGS="-O0"  生成的wheel文件保存在: /root/.cache/pip/wheels/cc/99/ab/d71e4d18bd33901983b7caf3e1ab75ad0c9a6d6f55b2b7939c/numpy-1.17.0-cp37-cp37m-linux_aarch64.whl 离线安装目前没有 arm的whl包设置python本地源,把wget https://files.pythonhosted.org/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip得包放置到本地源,pip install 安装 编译安装 pandas 0.24.2下载地址https://pypi.org/project/pandas/0.24.2/#filespip 在线安装pip install pandas==0.24.2生成了whl文件:后面可以用pandas-0.24.2-cp37-cp37m-linux_aarch64.whl 安装/root/.cache/pip/wheels/47/0a/bf/fd3647f5bc74698ed95dbdbb3d8d120cfe0280969c212cdb6c/pandas-0.24.2-cp37-cp37m-linux_aarch64.whl或者用打包命令:python setup.py bdist_wheelpip离线安装已安装numpy再安装如下组件:wget https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whlwget https://files.pythonhosted.org/packages/87/76/46d697698a143e05f77bec5a526bf4e56a0be61d63425b68f4ba553b51f2/pytz-2019.2-py2.py3-none-any.whlwget https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl然后安装 pandaswget https://files.pythonhosted.org/packages/b2/4c/b6f966ac91c5670ba4ef0b0b5613b5379e3c7abdfad4e7b89a87d73bae13/pandas-0.24.2.tar.gz或者使用在线安装后生成的pandas-0.24.2-cp37-cp37m-linux_aarch64.whl文件解压缩,进入 pandas源码文件夹pip install whl文件或者进入源码文件夹 pip install .  编译安装 mlflow 1.0.0安装过程:pip install mlflow==1.0.0 (在线安装)pip自动安装很多依赖 编译安装 scipy 1.3.0依赖提前安装:直接编译报很多错误,需要安装依赖:yum install -y atlas atlas-devel lapack lapack-devel gcc-gfortran安装scipy 1.3.0https://files.pythonhosted.org/packages/cb/97/361c8c6ceb3eb765371a702ea873ff2fe112fa40073e7d2b8199db8eb56e/scipy-1.3.0.tar.gz没有现成的whl,需要pip 安装生成pip install scipy==1.3.0直接运行即可  编译安装 scikit_learn 0.21.3安装pip install scikit_learn==0.21.3 直接安装即可 
  • [交流分享] 【化鲲为鹏,我有话说】numpy的安装和使用(鲲鹏开发者比赛)
    【化鲲为鹏,我有话说】鲲鹏开发者大赛,如何实现自己打包numpy到自己的作品包中,上传到服务器,而选择不使用服务器上的作品1、下载numpy package:https://numpy.org/ 2、将其放到与gameclient.sh 的文件夹下,3、在你的系统中调用的时候,注意头文件的引入的方式:请一定要直接这样引用,不要写路径。因为python具有init的文件夹就算做一个包。4、打包上传的时候,请务必也包含着numpy的这个包一起上传ps:曾经我也尝试过使用裁判服务器上的nunmpy的结果,但是基本上都是运行成功,所以为了实现自己打包的情况下以确定自己的包是否肯定打包成功的情况,可以首先在另外一台没有安装过numpy的电脑上面进行测试,如果可以正常的运行,那么同样的,提交到服务器也就不会默认调用服务器上的numpy服务器了
  • [交流分享] 华为鲲鹏服务器上编译的aarch 架构 tensorflow1.14.1和numpy1.16.4
    Ubuntu 18.04python 3.7.4在鲲鹏服务器上编译的安装时出现h5py安装失败需要先安装apt-get install libhdf5-serial-dev hdf5-tools解压后不要改whl包名,否则可能安装失败pip3 install numpy-1.16.4-cp37-cp37m-linux_aarch64.whlpip3 install tensorflow-1.14.1-cp37-cp37m-linux_aarch64.whl成功运行截图:
  • [交流分享] 鲲鹏云服务器可以用numpy-1.18.0 whl包
    鲲鹏云服务器可以用的numpy-1.18.0 whl包有需要的同学可以试试http://117.78.11.63/download/pip2.7 install http://117.78.11.63/download/numpy-1.16.5.dev0%2B4f641f3-cp27-cp27mu-linux_aarch64.whlpip3.6 install http://117.78.11.63/download/numpy-1.18.0.dev0%2B044f513-cp36-cp36m-linux_aarch64.whlpip3.7 install http://117.78.11.63/download/numpy-1.18.0.dev0%2B044f513-cp37-cp37m-linux_aarch64.whl
总条数:107 到第
上滑加载中