Firefly开源社区

标题: 在3399pro 安装tensorflow,出现“Failed building wheel for grpcio” [打印本页]

作者: c_cacal    时间: 2021-1-14 14:13
标题: 在3399pro 安装tensorflow,出现“Failed building wheel for grpcio”
在ubuntu18.04版本,3399pro,安装tensorflow总失败
  cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
  creating None
  creating None/tmp
  creating None/tmp/tmpcxy6_mcv
  aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c /tmp/tmpcxy6_mcv/a.c -o None/tmp/tmpcxy6_mcv/a.o
  Traceback (most recent call last):
    File "/usr/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
      extra_postargs)
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
      _classic_spawn(self, command)
    File "/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
      spawn(cmd, dry_run=self.dry_run)
    File "/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
      _spawn_posix(cmd, search_path, dry_run=dry_run)
    File "/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
      % (cmd, exit_status))
  distutils.errors.DistutilsExecError: command 'aarch64-linux-gnu-gcc' failed with exit status 4
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/commands.py", line 267, in build_extensions
      build_ext.build_ext.build_extensions(self)
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
      depends=ext.depends)
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 59, in _parallel_compile
      _compile_single_file, objects)
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
      return self._map_async(func, iterable, mapstar, chunksize).get()
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
      raise self._value
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
      result = (True, func(*args, **kwds))
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
      return list(map(*args))
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 54, in _compile_single_file
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/usr/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command 'aarch64-linux-gnu-gcc' failed with exit status 4
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-u5si8erx/grpcio/setup.py", line 488, in <module>
      cmdclass=COMMAND_CLASS,
    File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 204, in run
      self.run_command('build')
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 78, in run
      _build_ext.run(self)
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/commands.py", line 272, in build_extensions
      "Failed `build_ext` step:\n{}".format(formatted_exception))
  commands.CommandError: Failed `build_ext` step:
  Traceback (most recent call last):
    File "/usr/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
      extra_postargs)
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
      _classic_spawn(self, command)
    File "/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
      spawn(cmd, dry_run=self.dry_run)
    File "/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
      _spawn_posix(cmd, search_path, dry_run=dry_run)
    File "/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
      % (cmd, exit_status))
  distutils.errors.DistutilsExecError: command 'aarch64-linux-gnu-gcc' failed with exit status 4
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/commands.py", line 267, in build_extensions
      build_ext.build_ext.build_extensions(self)
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
      depends=ext.depends)
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 59, in _parallel_compile
      _compile_single_file, objects)
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
      return self._map_async(func, iterable, mapstar, chunksize).get()
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
      raise self._value
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
      result = (True, func(*args, **kwds))
    File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
      return list(map(*args))
    File "/tmp/pip-build-u5si8erx/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 54, in _compile_single_file
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/usr/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command 'aarch64-linux-gnu-gcc' failed with exit status 4
  
  
  ----------------------------------------
  Failed building wheel for grpcio
  Running setup.py clean for grpcio
Failed to build grpcio
Installing collected packages: grpcio, tensorflow


按着安装文档来的,16G+3G ,
pip3 install
    numpy==1.14.5 \
    protobuf==3.11.2 \
    onnx \
    scipy-1.2.0-cp36-cp36m-linux_aarch64.whl \
    tensorflow-1.10.1-cp36-cp36m-linux_aarch64.whl
    前面几个部分都安装成功
作者: c_cacal    时间: 2021-1-14 14:47
AIO-RK3399PROC-UBUNTU18.04-GPT-20200525-1016.img 刷机固件
作者: LovePing    时间: 2021-2-25 10:34
c_cacal 发表于 2021-1-14 14:47
AIO-RK3399PROC-UBUNTU18.04-GPT-20200525-1016.img 刷机固件

嘿,兄弟 我也是在3399上 遇到了这个问题,请问你现在解决了吗?你 tensorflow用的什么版本。
作者: 凌叶    时间: 2021-3-4 18:14
遇到了同样的问题,有人解决了吗?
ubuntu18.04
pip3版本:9.0.1
rknn版本:1.3.0
作者: 凌叶    时间: 2021-3-4 18:55
问题似乎解决了。
搜索报错发现,是grpcio编译过程的问题,网上有人通过升级pip解决了这个问题。
但是很显然这里不能乱升级pip,因此推测是grpcio版本过高,pip内的gcc版本不够导致的。
观察到ubuntu固件是在2020年5月发布的,因此当时能用的grcpio版本一定在2020年5月之前就已经发布。
查找pypi网站的grcpio项目,发现去年五月的版本最高到1.29.0。
而tensorflow要求的最低版本是1.8.0,理论上这两者之间的版本都有可能可以安装。
挑了一个看着顺眼的版本1.12.0,安装成功。

所以解决办法就是:在指令中指定grcpio版本。
pip3 install
    numpy==1.14.5 \
    protobuf==3.11.2 \
    onnx \
    grpcio==1.12.0 \
    scipy-1.2.0-cp36-cp36m-linux_aarch64.whl \
    tensorflow-1.10.1-cp36-cp36m-linux_aarch64.whl

同时希望管理员更新一下wiki,因为从现在往后的安装都是默认1.36.0及以后的版本的,应该都会报错。

作者: wx_Simon_UDU0Q    时间: 2021-3-15 21:57
凌叶 发表于 2021-3-4 18:55
问题似乎解决了。
搜索报错发现,是grpcio编译过程的问题,网上有人通过升级pip解决了这个问题。
但是很 ...

可以看下你的pip3 list吗
作者: wx_Simon_UDU0Q    时间: 2021-3-15 22:18
凌叶 发表于 2021-3-4 18:55
问题似乎解决了。
搜索报错发现,是grpcio编译过程的问题,网上有人通过升级pip解决了这个问题。
但是很 ...

还有 apt list --installed
作者: 小丿顺    时间: 2021-12-3 16:44
凌叶 发表于 2021-3-4 18:55
问题似乎解决了。
搜索报错发现,是grpcio编译过程的问题,网上有人通过升级pip解决了这个问题。
但是很 ...

您好,发现还是不行耶,,装到tensorflow的时候它有自动下载1.42.0的版本,,
作者: Celestesky    时间: 2022-1-4 12:57
解决了,十分感谢
作者: 竹一锋    时间: 2022-5-6 18:13
感谢,grpcio先下载指定版本后,tensorflow就可以正常安装了




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1