当我为自定义数据集运行对象检测API并在google cloud compute上初始化时。我得到了“无模块错误”。 我已经在conda env中安装了所有模块,那么为什么AI培训没有访问env python3.6及其模块enter image description here 我已经看过谷歌云平台的初始文档,但没有这方面的资料
gcloud ai-platform jobs submit training object_detection_`date +%m_%d_%Y_%H_%M_%S` \
--job-dir=gs://spike_detector/train \
--packages /home/sajid/phd/spike_detector/models/research/dist/object_detection-0.1.tar.gz,/home/sajid/phd/spike_detector/models/research/slim/dist/slim-0.1.tar.gz \
--module-name object_detection.model_main \
--region us-central1 \
--python-version 3.7 \
--runtime-version 1.15
--config /home/sajid/phd/spike_detector/spike_detector_gscloud/training.yaml \
-- \
--train_dir=gs://spike_detector/train \
--pipeline_config_path=gs://spike_detector/data/faster_rcnn_resnet101_pets.config
我得到了错误ModuleNotFoundError: No module named 'pycocotools'
ERROR 2020-02-16 17:43:06 +0500 master-replica-0 from pycocotools import coco[enter image description here][2]
ERROR 2020-02-16 17:43:06 +0500 master-replica-0 ModuleNotFoundError: No module named
AI平台在专门为培训作业配置的虚拟机中运行其作业,因此作业使用的每个依赖项都应该安装在这些机器中(仅在本地机器上安装它们是不够的)。这些虚拟机附带了许多已经安装的包,可以检查这些包
但是默认情况下不安装
pycocotools
,您应该明确指示AI平台安装它,方法是在作业的setup.py
文件中指定它,如here所述。这将使用pip install
在虚拟机上下载并安装依赖项安装依赖项的另一种方法是引用位于本地计算机中的包,这些包将在云中暂存,然后使用
packages
标志安装到培训计算机中,如here所述。我看到您已经在利用此功能导入其他包;您可以尝试向其添加包的位置pycocotools
我希望这能帮你解决错误
相关问题 更多 >
编程相关推荐