错误:命令'gcc'失败,退出状态为1;克隆后无法制作

时间:2018-03-15 11:24:03

标签: python-2.7 amazon-web-services tensorflow ubuntu-16.04

我试图运行eval.py来评估我的训练课程。为此,我需要安装cocodataset(请参阅下面的错误消息)。这是发生错误的地方。

我试过

  • sudo apt-get update&& sudo apt-get upgrade
  • 卸载并重新安装cython,gcc,numpy

在我看来,关于gcc有很多错误,这让我觉得我的错误可能与cocodataset无关,但可能与我的包或环境变量有关。我需要有关如何解决问题或可能在哪里寻找的建议/指示。任何帮助深表感谢!提前谢谢。

系统信息

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
Python 2.7.14 :: Anaconda, Inc

Running on AWS Deep Learning AMIs

错误

git clone https://github.com/pdollar/coco.git
Cloning into 'coco'...
remote: Counting objects: 927, done.
remote: Total 927 (delta 0), reused 0 (delta 0), pack-reused 927
Receiving objects: 100% (927/927), 11.68 MiB | 3.14 MiB/s, done.
Resolving deltas: 100% (554/554), done.
Checking connectivity... done.

(tensorflow_p27) ubuntu@remoteip:~/tmp$ cd coco/PythonAPI/

(tensorflow_p27) ubuntu@remoteip:~/tmp/coco/PythonAPI$ make
python setup.py build_ext --inplace
Compiling pycocotools/_mask.pyx because it changed.
[1/1] Cythonizing pycocotools/_mask.pyx
running build_ext
building 'pycocotools._mask' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/pycocotools
creating build/common
gcc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/numpy/core/include -I../common -I/home/ubuntu/anaconda3/envs/tensorflow_p27/include/python2.7 -c pycocotools/_mask.c -o build/temp.linux-x86_64-2.7/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
gcc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/numpy/core/include -I../common -I/home/ubuntu/anaconda3/envs/tensorflow_p27/include/python2.7 -c ../common/maskApi.c -o build/temp.linux-x86_64-2.7/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
gcc -pthread -shared -B /home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat -L/home/ubuntu/anaconda3/envs/tensorflow_p27/lib -Wl,-rpath=/home/ubuntu/anaconda3/envs/tensorflow_p27/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-2.7/pycocotools/_mask.o build/temp.linux-x86_64-2.7/../common/maskApi.o -L/home/ubuntu/anaconda3/envs/tensorflow_p27/lib -lpython2.7 -o /home/ubuntu/tmp/coco/PythonAPI/pycocotools/_mask.so
/home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat/ld: cannot find -lpthread
/home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 1

如上所示,我收到以下错误:命令'gcc'失败,退出状态为1

1 个答案:

答案 0 :(得分:1)

你完成了安装gcc吗?我认为你应该检查它,我在制作coco lib时遇到一些错误,我只是意识到主机出了问题包含了一些gcc包。 尝试:

unwrapBackT :: Maybe (a, BackT m a) -> m [a]

然后

innerToList :: m (Maybe (a, BackT m a)) -> m [a]

确保您已成功安装gcc。