我在使用对象检测 API 安装 TensorFlow 时遇到问题。\n我按照此 URL 中的步骤操作: https: //github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md
\n步骤:
\ngit clone https://github.com/tensorflow/models.git\n\ncd models/research\nprotoc object_detection/protos/*.proto --python_out=.\ncp object_detection/packages/tf2/setup.py .\npython -m pip install \nRun Code Online (Sandbox Code Playgroud)\n我得到的错误是 pycocotools builds erro
\nBuilding wheel for pycocotools (pyproject.toml) ... error\n error: subprocess-exited-with-error\n\n \xc3\x97 Building wheel for pycocotools (pyproject.toml) did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [14 lines of output]\n running bdist_wheel\n running build\n running build_py\n creating build\n creating build\\lib.win-amd64-cpython-38\n creating build\\lib.win-amd64-cpython-38\\pycocotools\n copying pycocotools\\coco.py -> build\\lib.win-amd64-cpython-38\\pycocotools\n copying pycocotools\\cocoeval.py -> build\\lib.win-amd64-cpython-38\\pycocotools\n copying pycocotools\\mask.py …Run Code Online (Sandbox Code Playgroud) python python-3.x object-detection-api tensorflow2.0 pycocotools
我正在使用 python coco api 来运行对象检测的评估。我有两个文件,一个ground truth json和一个results json。该COCO笔记本演示仅适用于所有类运行EVAL节目。如何只为一个特定的类或类的子集运行它?目前我正在这样做:
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
annType = 'bbox'
cocoGt=COCO(gt_json)
cocoDt=cocoGt.loadRes(results_json)
imgIds=sorted(cocoGt.getImgIds())
# running evaluation
cocoEval = COCOeval(cocoGt,cocoDt,annType)
cocoEval.params.imgIds = imgIds
cocoEval.evaluate()
cocoEval.accumulate()
cocoEval.summarize()
Run Code Online (Sandbox Code Playgroud) 我是机器学习的新手,已经开始使用配备 GeForce GTX 540M 的 Windows 8.1 电脑。我按照本教程开始使用对象检测模型。我构建了自己的数据集并尝试按照教程对其进行训练,但使用“ssd_mobilenet_v1_coco_2017_11_17”模型。但是无法成功执行,因为我在使用教程中给出的“train.py”文件时遇到了麻烦。
所以我用谷歌搜索,发现我们必须使用“model_main.py”来训练模型。在尝试使用“model_main.py”进行训练时,出现此错误:
"ImportModuleError: No module named 'pycocotools' was found"
所以我尝试从这个链接安装 cocoapi 。我按照给定的说明进行操作,但遇到了下面显示的错误,我尝试了很多解决方案,但没有任何效果。任何帮助都感激不尽。
(tensorflow1) C:\tensorflow1\models\research\object_detection>pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Cloning https://github.com/philferriere/cocoapi.git to c:\users\home\appdata\l
ocal\temp\pip-req-build-76t4e6ys
Building wheels for collected packages: pycocotools
Running setup.py bdist_wheel for pycocotools ... error
Complete output from command c:\users\home\anaconda3\envs\tensorflow1\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Home\\AppData\\Local\\Temp\\pip-req-build-76t4e6ys\\PythonAPI\\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 C:\Users\Home\AppData\Local\Temp\pip-wheel-4_r37hm6 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\pycocotools
copying pycocotools\coco.py …Run Code Online (Sandbox Code Playgroud) 我尝试在 python 3.6.9 环境中安装 pycocotools 时遇到问题。
\n\n我正在 Windows 10 上运行 ubuntu 18.04。我已经创建了一个环境并激活了它。我想安装软件包并使用:
\n\npip install <package> --user\nRun Code Online (Sandbox Code Playgroud)\n\n当我安装 cython 时,它工作正常,但是当我安装 pycocotools 时:
\n\npip install pycocotools --user\nRun Code Online (Sandbox Code Playgroud)\n\n我的错误如下:
\n\nDownloading https://files.pythonhosted.org/packages/96/84/9a07b1095fd8555ba3f3d519517c8743c2554a245f9476e5e39869f948d2/pycocotools-2.0.0.tar.gz (1.5MB)\n100% |\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88| 1.5MB 1.9MB/s\nComplete output from command python setup.py egg_info:\nTraceback (most recent call last):\n File "<string>", line 1, in <module>\n File "/tmp/pip-build-mut7_bkf/pycocotools/setup.py", line 2, in <module>\n from Cython.Build import cythonize\nModuleNotFoundError: No module named \'Cython\'\n\n----------------------------------------\nCommand "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mut7_bkf/pycocotools/\nRun Code Online (Sandbox Code Playgroud)\n\n我不明白这个错误,因为之前安装了 …
我是机器学习新手,我正在尝试使用以下命令下载存储库的要求
pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud)
我目前使用的是 Anaconda (3.7) 版本 2020.02。所有其他要求都已满足,这是我收到的错误:
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Hp\anaconda3\envs\wob1\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Hp\\AppData\\Local\\Temp\\pip-req-build-mfm5emhp\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\Hp\\AppData\\Local\\Temp\\pip-req-build-mfm5emhp\\PythonAPI\\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 'C:\Users\Hp\AppData\Local\Temp\pip-wheel-g2bhmm6i'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-req-build-mfm5emhp\PythonAPI
Complete output (22 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools\mask.py -> …Run Code Online (Sandbox Code Playgroud) 操作系统:Windows 7
蟒蛇:Python 3.7.3
康达:康达 4.8.2
Step1:通过链接器访问从github下载pococtools的源代码:https : //github.com/philferriere/cocoapi
Step2:通过运行构建和安装 pococotall 包
python setup.py build_ext --inplace,
python setup.py build_ext install
Run Code Online (Sandbox Code Playgroud)
随后。
ModuleNotFoundError:没有名为“Cython”的模块 在此处输入图像描述
解决方案: pip install Cython
错误:命令“cl.exe”失败:没有这样的文件或目录 在此处输入图像描述
解决方案:安装 Visual Studio 2019 并确保安装“Desktop development with c++”环境。
处理完所有问题后,您可以运行两个instrustion完成安装。您可以运行
conda list
Run Code Online (Sandbox Code Playgroud)
然后检查pycocotools。 在此处输入图片说明
我正在尝试使用 Tensorflow 中的对象检测模型,并且需要安装 pycocotools。我在 Windows 10 计算机上的 python (3) 虚拟环境中执行此操作。在 Windows 上运行此功能似乎存在一些已知问题,我很确定我已经尝试过所有这些问题。
我尝试过 pip 安装 pycocotools,但出现此错误(构建轮子失败):
(env) PS C:\Users\la01043601\ML_CameraVision\humanDetection> pip install pycocotools
Collecting pycocotools
Using cached pycocotools-2.0.2.tar.gz (23 kB)
Requirement already satisfied: setuptools>=18.0 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from pycocotools) (56.0.0)
Requirement already satisfied: cython>=0.27.3 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from pycocotools) (0.29.23)
Requirement already satisfied: matplotlib>=2.1.0 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from pycocotools) (3.4.2)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (2.4.7)
Requirement already satisfied: cycler>=0.10 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (0.10.0)
Requirement already satisfied: pillow>=6.2.0 in c:\users\la01043601\ml_cameravision\humandetection\env\lib\site-packages …Run Code Online (Sandbox Code Playgroud) 这是getImgIds来自pycocotools:
pycocotools/coco.py:
def getImgIds(self, imgIds=[], catIds=[]):
'''
Get img ids that satisfy given filter conditions.
:param imgIds (int array) : get imgs for given ids
:param catIds (int array) : get imgs with all given cats
:return: ids (int array) : integer array of img ids
'''
imgIds = imgIds if _isArrayLike(imgIds) else [imgIds]
catIds = catIds if _isArrayLike(catIds) else [catIds]
if len(imgIds) == len(catIds) == 0:
ids = self.imgs.keys()
else:
ids = set(imgIds)
for i, …Run Code Online (Sandbox Code Playgroud) pycocotools ×8
python ×7
python-3.x ×2
tensorflow ×2
windows ×2
anaconda ×1
c++ ×1
mscoco ×1
pip ×1
subset ×1