Firefly开源社区

打印 上一主题 下一主题

在3399pro 安装tensorflow,出现“Failed building wheel for grpcio”

23

积分

0

威望

0

贡献

技术小白

积分
23

在3399pro 安装tensorflow,出现“Failed building wheel for grpcio”

发表于 2021-1-14 14:13:07      浏览:12460 | 回复:9        打印      只看该作者   [复制链接] 楼主
在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
    前面几个部分都安装成功
回复

使用道具 举报

23

积分

0

威望

0

贡献

技术小白

积分
23
发表于 2021-1-14 14:47:40        只看该作者  沙发
AIO-RK3399PROC-UBUNTU18.04-GPT-20200525-1016.img 刷机固件
回复

使用道具 举报

12

积分

0

威望

0

贡献

技术小白

积分
12
发表于 2021-2-25 10:34:29        只看该作者  板凳
c_cacal 发表于 2021-1-14 14:47
AIO-RK3399PROC-UBUNTU18.04-GPT-20200525-1016.img 刷机固件

嘿,兄弟 我也是在3399上 遇到了这个问题,请问你现在解决了吗?你 tensorflow用的什么版本。
回复

使用道具 举报

5

积分

0

威望

0

贡献

吃瓜的群众

积分
5
发表于 2021-3-4 18:14:46        只看该作者  地板
遇到了同样的问题,有人解决了吗?
ubuntu18.04
pip3版本:9.0.1
rknn版本:1.3.0
回复

使用道具 举报

5

积分

0

威望

0

贡献

吃瓜的群众

积分
5
发表于 2021-3-4 18:55:06        只看该作者  5#
问题似乎解决了。
搜索报错发现,是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及以后的版本的,应该都会报错。
回复

使用道具 举报

33

积分

0

威望

0

贡献

技术小白

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

可以看下你的pip3 list吗
回复

使用道具 举报

33

积分

0

威望

0

贡献

技术小白

积分
33
发表于 2021-3-15 22:18:28        只看该作者  7#
凌叶 发表于 2021-3-4 18:55
问题似乎解决了。
搜索报错发现,是grpcio编译过程的问题,网上有人通过升级pip解决了这个问题。
但是很 ...

还有 apt list --installed
回复

使用道具 举报

11

积分

0

威望

0

贡献

技术小白

积分
11
发表于 2021-12-3 16:44:27        只看该作者  8#
凌叶 发表于 2021-3-4 18:55
问题似乎解决了。
搜索报错发现,是grpcio编译过程的问题,网上有人通过升级pip解决了这个问题。
但是很 ...

您好,发现还是不行耶,,装到tensorflow的时候它有自动下载1.42.0的版本,,
回复

使用道具 举报

6

积分

0

威望

0

贡献

吃瓜的群众

积分
6
发表于 2022-1-4 12:57:47        只看该作者  9#
解决了,十分感谢
回复

使用道具 举报

4

积分

0

威望

0

贡献

吃瓜的群众

积分
4
发表于 2022-5-6 18:13:01        只看该作者  10#
感谢,grpcio先下载指定版本后,tensorflow就可以正常安装了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表