TensorFlow model实例错误记录1

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/heybeaman/article/details/84987532

在测试TensorFlow model实例的时候出现错误:

1, pycocotools缺失

pip install pycocotools

出现 error: Microsoft Visual C++ 14.0 is required.  尝试下载Microsoft Visual C++等文件,安装后仍然不成功,出现错误:

 cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

解决办法:
下载cocoapi :https://github.com/cocodataset/cocoapi
将cocoapi-master\PythonAPI中的setup.py中的第12行

extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99']

改为

extra_compile_args={'gcc': ['/Qstd=c99']}

然后执行 python setup.py build_ext --inplace

将编译好的pycocotools目录 拷到python的库目录C:\Anaconda3\Lib\site-packages\pycocotools即可

参考:https://github.com/cocodataset/cocoapi/issues/51

猜你喜欢

转载自blog.csdn.net/heybeaman/article/details/84987532
今日推荐