gpt4 book ai didi

python - [Tensorflow][对象检测]尝试使用 --num_clones=2 进行训练时出现 ValueError

转载 作者:太空宇宙 更新时间:2023-11-03 11:17:40 26 4
gpt4 key购买 nike

我想在多个 CPU 上训练,所以我运行这个命令

C:\Users\solution\Desktop\Tensorflow\research>python object_detection/train.py --logtostderr --pipeline_config_path=C:\Users\solution\Desktop\Tensorflow\myFolder\power_drink.config --train_dir=C:\Users\solution\Desktop\Tensorflow\research\object_detection\train --num_clones=2 --clone_on_cpu=True

我得到了以下错误

Traceback (most recent call last): File "object_detection/train.py", line 169, in tf.app.run() File "C:\Users\solution\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 124, in run _sys.exit(main(argv)) File "object_detection/train.py", line 165, in main worker_job_name, is_chief, FLAGS.train_dir) File "C:\Users\solution\Desktop\Tensorflow\research\object_detection\trainer.py", line 246, in train clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue]) File "C:\Users\solution\Desktop\Tensorflow\research\slim\deployment\model_deploy.py", line 193, in create_clones outputs = model_fn(*args, **kwargs) File "C:\Users\solution\Desktop\Tensorflow\research\object_detection\trainer.py", line 158, in _create_losses train_config.merge_multiple_label_boxes) ValueError: not enough values to unpack (expected 7, got 0)

如果我将 num_clones 设置为 1 或省略它,它会正常工作。我也尝试设置 --ps_tasks=1 这没有帮助

如有任何建议,我们将不胜感激

最佳答案

我通过稍微更改原始配置中的一个参数解决了这个问题:

...
train_config: {
fine_tune_checkpoint: "C:/some_path/model.ckpt"
batch_size: 1
sync_replicas: true
startup_delay_steps: 0
replicas_to_aggregate: 8
num_steps: 25000
...
}
...

更改参数 replicas_to_aggregate: 1 或设置 sync_replicas: false 都解决了我的问题,因为我只在一张显卡上训练并且没有任何副本(就像在 TPU 上训练时一样)。

关于python - [Tensorflow][对象检测]尝试使用 --num_clones=2 进行训练时出现 ValueError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48795950/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com