Tensorflow GPU模型无法训练自定义图像

时间:2018-06-28 10:36:05

标签: python tensorflow machine-learning object-detection

我最近一直在使用GPU处理器进行张量流对象检测,并且在尝试使用自定义图像训练模型时遇到错误。错误跟踪堆栈如下:

 WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\trainer.py:260: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.create_global_step
WARNING:tensorflow:num_readers has been reduced to 1 to match input file shards.
Traceback (most recent call last):
  File "train.py", line 184, in <module>
    tf.app.run()
  File "C:\Users\Dan\AppData\Local\conda\conda\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
    _sys.exit(main(argv))
  File "train.py", line 180, in main
    graph_hook_fn=graph_rewriter_fn)
  File "C:\tensorflow1\models\research\object_detection\trainer.py", line 274, in train
    train_config.prefetch_queue_capacity, data_augmentation_options)
  File "C:\tensorflow1\models\research\object_detection\trainer.py", line 80, in create_input_queue
    include_keypoints=include_keypoints))
  File "C:\tensorflow1\models\research\object_detection\core\preprocessor.py", line 3147, in preprocess
    (func.__name__))
ValueError: The function random_horizontal_flip does not exist in func_arg_map

我正在将Anaconda解释器与Python 3.6配合使用,因此我重现了此错误,我遵循链接https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10中的所有步骤。

给我这个错误的命令是:

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

重要的是要注意,在训练模型之前我没有遇到任何问题。如果有人可以向我解释这个错误,甚至帮助我解决这个问题,我将非常感激,在此先感谢:-)

1 个答案:

答案 0 :(得分:0)

您可能会忘记将以下行添加到~/.bashrc中: export PYTHONPATH=$PYTHONPATH: pwd : pwd /slim