发新帖

【TF目标识别】训练过程出现异常,麻烦谁帮忙看一下咋回...

[复制链接]
643 13

快来加入 TensorFlowers 大家庭!

您需要 登录 才可以下载或查看,没有帐号?加入社区

x
D:\yuany\13 workspace\05 tensorflow\models\research>python object_detection/train.py --logtostderr --train_dir=E:/data --pipeline_config_path=E:/data/faster_rcnn_resnet101_pets.config
d:\ProgramData\Anaconda3\lib\site-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
WARNING:tensorflow:From D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py:262: 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 0 to match input file shards.
Traceback (most recent call last):
  File "object_detection/train.py", line 183, in <module>
    tf.app.run()
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/train.py", line 179, in main
    graph_hook_fn=graph_rewriter_fn)
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py", line 276, in train
    train_config.prefetch_queue_capacity, data_augmentation_options)
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py", line 59, in create_input_queue
    tensor_dict = create_tensor_dict_fn()
  File "object_detection/train.py", line 120, in get_next
    dataset_builder.build(config)).get_next()
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\builders\dataset_builder.py", line 134, in build
    config.input_path[:], input_reader_config)
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\builders\dataset_builder.py", line 80, in read_dataset
    sloppy=config.shuffle))
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 973, in apply
    dataset = transformation_func(self)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\contrib\data\python\ops\interleave_ops.py", line 76, in _apply_fn
    buffer_output_elements, prefetch_input_elements)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\readers.py", line 130, in __init__
    cycle_length, block_length)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 1959, in __init__
    super(InterleaveDataset, self).__init__(input_dataset, map_func)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 1928, in __init__
    self._map_func.add_to_graph(ops.get_default_graph())
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 484, in add_to_graph
    self._create_definition_if_needed()
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 319, in _create_definition_if_needed
    self._create_definition_if_needed_impl()
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 336, in _create_definition_if_needed_impl
    outputs = self._func(*inputs)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 1916, in tf_map_func
    dataset = map_func(nested_args)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\readers.py", line 196, in __init__
    filenames = ops.convert_to_tensor(filenames, dtype=dtypes.string)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1014, in convert_to_tensor
    as_ref=False)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1104, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 947, in _TensorTensorConversionFunction
    (dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype string for Tensor with dtype float32: 'Tensor("arg0:0", shape=(), dtype=float32)'


我知道答案 回答被采纳将会获得10 金币 + 5 金币 已有13人回答
本楼点评(0) 收起

精彩评论13

galosy  TF荚荚  发表于 2018-7-11 14:16:41 | 显示全部楼层
哪位大神能帮忙看下啊,我现在是毫无头绪
本楼点评(0) 收起
neverchange  TF豆豆  发表于 2018-7-11 15:17:46 | 显示全部楼层
看一下第一行第二行和最后一行的报错,应该是参数类型不对,你再核对一下你的命令行参数格式。
本楼点评(0) 收起
galosy  TF荚荚  发表于 2018-7-11 15:46:07 | 显示全部楼层
neverchange 发表于 2018-7-11 15:17
看一下第一行第二行和最后一行的报错,应该是参数类型不对,你再核对一下你的命令行参数格式。 ...

命令行参数如下:目录文件确保是存在的
python object_detection/train.py --logtostderr --train_dir=E:/data --pipeline_config_path=E:/data/faster_rcnn_resnet101_pets.config  



D:\yuany\13 workspace\05 tensorflow\models\research>python object_detection/train.py --logtostderr --train_dir=E:/data --pipeline_config_path=E:/data/faster_rcnn_resnet101_pets.config
d:\ProgramData\Anaconda3\lib\site-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
WARNING:tensorflow:From D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py:262: 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 0 to match input file shards.
Traceback (most recent call last):
  File "object_detection/train.py", line 183, in <module>
    tf.app.run()
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/train.py", line 179, in main
    graph_hook_fn=graph_rewriter_fn)
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py", line 276, in train
    train_config.prefetch_queue_capacity, data_augmentation_options)
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py", line 59, in create_input_queue
    tensor_dict = create_tensor_dict_fn()
  File "object_detection/train.py", line 120, in get_next
    dataset_builder.build(config)).get_next()
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\builders\dataset_builder.py", line 134, in build
    config.input_path[:], input_reader_config)
  File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\builders\dataset_builder.py", line 80, in read_dataset
    sloppy=config.shuffle))
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 973, in apply
    dataset = transformation_func(self)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\contrib\data\python\ops\interleave_ops.py", line 76, in _apply_fn
    buffer_output_elements, prefetch_input_elements)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\readers.py", line 130, in __init__
    cycle_length, block_length)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 1959, in __init__
    super(InterleaveDataset, self).__init__(input_dataset, map_func)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 1928, in __init__
    self._map_func.add_to_graph(ops.get_default_graph())
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 484, in add_to_graph
    self._create_definition_if_needed()
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 319, in _create_definition_if_needed
    self._create_definition_if_needed_impl()
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 336, in _create_definition_if_needed_impl
    outputs = self._func(*inputs)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 1916, in tf_map_func
    dataset = map_func(nested_args)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\data\ops\readers.py", line 196, in __init__
    filenames = ops.convert_to_tensor(filenames, dtype=dtypes.string)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1014, in convert_to_tensor
    as_ref=False)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1104, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 947, in _TensorTensorConversionFunction
    (dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype string for Tensor with dtype float32: 'Tensor("arg0:0", shape=(), dtype=float32)'

D:\yuany\13 workspace\05 tensorflow\models\research>

本楼点评(0) 收起
neverchange  TF豆豆  发表于 2018-7-12 08:44:59 | 显示全部楼层
本帖最后由 neverchange 于 2018-7-12 08:48 编辑

这个stack和你贴子里的一样啊,train.py是你自己写的吧,这个需要你自己check代码读取参数的部分,或者你贴出来这个文件,我帮你看看。你重点看看下面错误的定位。
  1. Traceback (most recent call last):
  2.   File "object_detection/train.py", line 183, in <module>
  3.     tf.app.run()
  4.   File "d:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
  5.     _sys.exit(main(argv))
  6.   File "object_detection/train.py", line 179, in main
  7.     graph_hook_fn=graph_rewriter_fn)
  8.   File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py", line 276, in train
  9.     train_config.prefetch_queue_capacity, data_augmentation_options)
  10.   File "D:\yuany\13 workspace\05 tensorflow\models\research\object_detection\trainer.py", line 59, in create_input_queue
  11.     tensor_dict = create_tensor_dict_fn()
  12.   File "object_detection/train.py", line 120, in get_next
  13.     dataset_builder.build(config)).get_next()
复制代码



本楼点评(0) 收起
galosy  TF荚荚  发表于 2018-7-12 17:13:15 | 显示全部楼层
neverchange 发表于 2018-7-12 08:44
这个stack和你贴子里的一样啊,train.py是你自己写的吧,这个需要你自己check代码读取参数的部分,或者你贴 ...

object_detection/train.py,是TensorFlow里面的model模块里面的训练函数,不是我新写的
本楼点评(0) 收起
ViolinSolo  TF豆豆  发表于 2018-7-13 15:52:43 | 显示全部楼层
有代码之类的嘛,,,目前看下来貌似是tensor构建的时候哪里写错了,,,但是没看到代码有点蛋疼
本楼点评(0) 收起
galosy  TF荚荚  发表于 2018-7-13 15:56:26 | 显示全部楼层
ViolinSolo 发表于 2018-7-13 15:52
有代码之类的嘛,,,目前看下来貌似是tensor构建的时候哪里写错了,,,但是没看到代码有点蛋疼 ...

https://github.com/tensorflow/mo ... ch/object_detection 开源的代码
本楼点评(0) 收起
ViolinSolo  TF豆豆  发表于 2018-7-13 16:13:12 | 显示全部楼层
galosy 发表于 2018-7-13 15:56
https://github.com/tensorflow/models/tree/master/research/object_detection 开源的代码

唔,为什么我翻了翻也没找到train.py  我看你不是运行了
  1. python object_detection/train.py -
复制代码
嘛,为何我没找到呀,你是哪个版本的tf呢~
本楼点评(0) 收起
galosy  TF荚荚  发表于 2018-7-13 16:17:29 | 显示全部楼层
ViolinSolo 发表于 2018-7-13 16:13
唔,为什么我翻了翻也没找到train.py  我看你不是运行了嘛,为何我没找到呀,你是哪个版本的tf呢~
...

看图,我用的1.8的TF
xx.jpg
本楼点评(0) 收起
ViolinSolo  TF豆豆  发表于 2018-7-13 16:23:06 | 显示全部楼层
galosy 发表于 2018-7-13 16:17
看图,我用的1.8的TF

哈囧,我先研究下,是不是要切各分支什么的,给你看看我的。。。。 Capture.PNG

本楼点评(1) 收起
galosy  TF荚荚  发表于 2018-7-13 16:26:28 | 显示全部楼层
ViolinSolo 发表于 2018-7-13 16:23
哈囧,我先研究下,是不是要切各分支什么的,给你看看我的。。。。

晕了,你这个比我这边跑不起来问题还大,不过我换了个自己做的数据集,自己跑了个训练模型成功了,网上下载的数据集没跑起来。
本楼点评(0) 收起
ViolinSolo  TF豆豆  发表于 2018-7-13 16:30:54 | 显示全部楼层
galosy 发表于 2018-7-13 16:26
晕了,你这个比我这边跑不起来问题还大,不过我换了个自己做的数据集,自己跑了个训练模型成功了,网上下 ...

这个很尴尬了,我感觉他应该是改名字了,,虽然不知道怎么做到的,,明明更新时间都没变哈哈哈,emmm 自己的数据能用就好了,,,网上数据集跑不起来正常,,当然如果是那种很常见的公开数据集跑不起来就有点不正常了
本楼点评(0) 收起
您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

主题

帖子

10

积分
快速回复 返回顶部 返回列表