python - Tensorflow无法训练模型

标签 python tensorflow object-detection

我已按照本教程来训练我的自定义对象,但在训练模型步骤中执行以下命令:

python train.py --logtostderr --train_dir=training/--pipeline_config_path=training/ssd_inception_v2_coco.config

我得到这个结果:

(tensorflow_cpu) C:\Users\sid\Documents\Tensorflow\models\research\object_detection\legacy>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_inception_v2_coco.config

Traceback (most recent call last):
  File "train.py", line 51, in <module>
    from object_detection.builders import model_builder
  File "C:\Users\sid\Anaconda3\envs\tensorflow_cpu\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\builders\model_builder.py", line 35, in <module>
    from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res
  File "C:\Users\sid\Anaconda3\envs\tensorflow_cpu\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\models\faster_rcnn_inception_resnet_v2_feature_extractor.py", line 29, in <module>
    from nets import inception_resnet_v2
ModuleNotFoundError: No module named 'nets'

最佳答案

您可能需要安装软件包“nets”

在 Linux 中,这意味着在终端中输入以下内容:

pip install nets

当然,那么你需要在 python 脚本中添加导入行:

import nets

关于python - Tensorflow无法训练模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57716770/

相关文章:

python - 如何理解tf.Session的target?

opencv - Hog 描述符是在 peopledetect.cpp 中构造的吗?

c++ - Tensorflow 对象检测 API 是否有 C++ 包装器?

python - 将用户添加到组访问权限

python - 模拟 : assert mock_calls with a numpy array as argument raises ValueError and np. testing.assert_array_equal 不起作用

python - Django 管理站点 -- 查看路径 "admin/"at "/"

python - 无法使用贡献模块让 PELU 或 SineRelu 激活函数在 keras 中工作

python - 糟糕的 Django 管理性能

python - Tensorflow只保存检查点文件,不保存其他数据

deep-learning - ResNet-101 特征图形状