在 google colab 中训练对象检测模型时没有模块名称部署错误

No module name deployment error while train the object detection model in google colab

我是 Malathi,我尝试使用 google colab 训练对象检测模型。训练此模型时出现错误 no module name deployment。但我在 tensorflow-gpu 中训练了同一个文件,它会正常工作。

/usr/local/lib/python3.6/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Traceback (most recent call last):
  File "train.py", line 49, in <module>
    from object_detection import trainer
  File "/content/my_drive/tut_kaggle/zero/models/research/object_detection/trainer.py", line 33, in <module>
    from deployment import model_deploy
ModuleNotFoundError: No module named 'deployment'

这是训练代码

!unset DISPLAY XAUTHORITY
!xvfb-run python3 train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_pets.config

试试这个在 PYTHONPATH 中设置 slim。应该可以。

%set_env PYTHONPATH=/content/models/research:/content/models/research/slim