Retinanet网络的安装问题:error: command 'gcc' failed with exit status 1的解决办法

一:安装步骤

  • 1.打开Git,克隆retinanet代码到本地:
git clone https://github.com/fizyr/keras-retinanet.git
  • 2.在当前存储目录下keras-retinanet-master中,执行:
pip3 install . --user

NOTE:由于自定义安装tensorflow,这个软件包并没有定义对tensorflow相应的依赖关系,因为它会尝试安装tensorflow(至少在Arch Linux会导致错)。 请确保tensorflow按照个人的系统要求进行安装。 另外,确保安装Keras 2.2.0或更高版本。注意:pip2 install . --user,针对的是python2版本。第2步目的是为了后面导入包 import keras_resnet等不报错。比如找不到 compute_overlap函数的问题。

  • 3.如果相对COCO数据集进行测试,需要安装pycocotools,命令如下:
pip3 install --user git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI

也可以从官网下载COCOAPI代码,自己用命令行安装。

git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
make

Windows系统和Linux系统下pycocotools的安装方法参见下面:

  • Windows下pycocotools的安装————–传送门

  • Linux下pycocotools的安装————–传送门


问题:

在进行第2步安装时,在目录keras-retinanet-master下执行以下代码:

nkdx@nkdx:~/shuyu/keras-retinanet-master$ pip3 install . --user

出现了如下错误:

Processing /home/nkdx/shuyu/keras-retinanet-master
Requirement already satisfied: keras in /home/nkdx/anaconda3/lib/python3.5/site-packages (from keras-retinanet==0.4.1) (2.1.5)
Requirement already satisfied: keras-resnet in /home/nkdx/.local/lib/python3.5/site-packages (from keras-retinanet==0.4.1) (0.1.0)
Requirement already satisfied: six in /home/nkdx/anaconda3/lib/python3.5/site-packages (from keras-retinanet==0.4.1) (1.11.0)
Requirement already satisfied: scipy in /home/nkdx/anaconda3/lib/python3.5/site-packages (from keras-retinanet==0.4.1) (1.0.0)
Requirement already satisfied: cython in /home/nkdx/anaconda3/lib/python3.5/site-packages (from keras-retinanet==0.4.1) (0.27.3)
Requirement already satisfied: pyyaml in /home/nkdx/anaconda3/lib/python3.5/site-packages (from keras->keras-retinanet==0.4.1) (3.12)
Requirement already satisfied: numpy>=1.9.1 in /home/nkdx/anaconda3/lib/python3.5/site-packages (from keras->keras-retinanet==0.4.1) (1.14.3)
Building wheels for collected packages: keras-retinanet
  Running setup.py bdist_wheel for keras-retinanet ... error
  Complete output from command /home/nkdx/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-rfhv874f/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/pip-wheel-3o8jcs_m --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/tests
  copying tests/test_losses.py -> build/lib.linux-x86_64-3.5/tests
  copying tests/__init__.py -> build/lib.linux-x86_64-3.5/tests
  creating build/lib.linux-x86_64-3.5/keras_retinanet
  copying keras_retinanet/losses.py -> build/lib.linux-x86_64-3.5/keras_retinanet
  copying keras_retinanet/initializers.py -> build/lib.linux-x86_64-3.5/keras_retinanet
  copying keras_retinanet/__init__.py -> build/lib.linux-x86_64-3.5/keras_retinanet
  creating build/lib.linux-x86_64-3.5/tests/backend
  copying tests/backend/test_common.py -> build/lib.linux-x86_64-3.5/tests/backend
  copying tests/backend/__init__.py -> build/lib.linux-x86_64-3.5/tests/backend
  creating build/lib.linux-x86_64-3.5/tests/utils
  copying tests/utils/test_transform.py -> build/lib.linux-x86_64-3.5/tests/utils
  copying tests/utils/__init__.py -> build/lib.linux-x86_64-3.5/tests/utils
  creating build/lib.linux-x86_64-3.5/tests/preprocessing
  copying tests/preprocessing/test_generator.py -> build/lib.linux-x86_64-3.5/tests/preprocessing
  copying tests/preprocessing/test_csv_generator.py -> build/lib.linux-x86_64-3.5/tests/preprocessin
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值