Darkflow: 新数据集训练错误 - “AttributeError: 'NoneType' 对象没有属性 'shape'”

创建于 2017-05-30  ·  23评论  ·  资料来源: thtrieu/darkflow

你好,

我正在训练一个新的数据集。 但是,训练总是跑几步,突然遇到如下错误:“AttributeError: 'NoneType' object has no attribute 'shape'”。 我认为注释文件中的注释格式和文件名是正确的,因为训练能够运行几个步骤并且正在运行有关如何进一步排除故障的想法。

感谢任何想法或帮助。

谢谢你。

root<strong i="9">@dd84391fd870</strong>:/ml/darkflow# flow --model cfg/tiny-yolo-new.cfg --train --dataset "../data/new/JPEGImages" --annotation "../data/new/Annotations"

Parsing cfg/tiny-yolo-new.cfg
Loading None ...
Finished in 0.00011324882507324219s

Building net ...
Source | Train? | Layer description                | Output size
-------+--------+----------------------------------+---------------
       |        | input                            | (?, 416, 416, 3)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 416, 416, 16)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 208, 208, 16)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 208, 208, 32)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 104, 104, 32)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 104, 104, 64)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 52, 52, 64)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 52, 52, 128)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 26, 26, 128)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 26, 26, 256)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 13, 13, 256)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 512)
 Load  |  Yep!  | maxp 2x2p0_1                     | (?, 13, 13, 512)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Init  |  Yep!  | conv 1x1p0_1    linear           | (?, 13, 13, 40)
-------+--------+----------------------------------+---------------
Running entirely on CPU
cfg/tiny-yolo-new.cfg loss hyper-parameters:
    H       = 13
    W       = 13
    box     = 5
    classes = 3
    scales  = [1.0, 5.0, 1.0, 1.0]
Building cfg/tiny-yolo-new.cfg loss
Building cfg/tiny-yolo-new.cfg train op
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
Finished in 7.207982778549194s

Enter training ...

cfg/tiny-yolo-new.cfg parsing ../data/new/Annotations
Parsing for ['tank', 'truck', 'apc'] 
[====================>]100%  000296.xml
Statistics:
apc: 48
tank: 70
truck: 24
Dataset size: 130
Dataset of 130 instance(s)
Training statistics: 
    Learning rate : 1e-05
    Batch size    : 16
    Epoch number  : 1000
    Backup every  : 2000
step 1 - loss 106.16172790527344 - moving ave loss 106.16172790527344
step 2 - loss 106.1773681640625 - moving ave loss 106.16329193115234
step 3 - loss 106.09341430664062 - moving ave loss 106.15630416870117
step 4 - loss 106.24054718017578 - moving ave loss 106.16472846984863
step 5 - loss 106.12216186523438 - moving ave loss 106.1604718093872
step 6 - loss 106.24075317382812 - moving ave loss 106.1684999458313
Traceback (most recent call last):
  File "/usr/local/bin/flow", line 6, in <module>
    cliHandler(sys.argv)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/cli.py", line 29, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/flow.py", line 37, in train
    for i, (x_batch, datum) in enumerate(batches):
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolo/data.py", line 113, in shuffle
    inp, new_feed = self._batch(train_instance)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolov2/data.py", line 27, in _batch
    img = self.preprocess(path, allobj)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolo/predict.py", line 61, in preprocess
    result = imcv2_affine_trans(im)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/utils/im_transform.py", line 19, in imcv2_affine_trans
    h, w, c = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

最有用的评论

我过去遇到过这种情况。 很有可能某些.xml.jpg文件没有正确命名/配置。 调试问题的一种方法是添加

print(jpg)

在此行之后: https ://github.com/thtrieu/darkflow/blob/master/darkflow/net/yolov2/data.py#L26

因此,您将能够看到损坏文件的名称并调查其.xml.jpg

所有23条评论

检查您的 xml 文件,文件名是否包含图像的扩展名?

是的,文件名包括我的图像的扩展名:.jpg。

下面是其中一个xml文件:

<annotation>
  <folder>JPEGImages</folder>
  <filename>/ml/data/new/JPEGImages/000004.jpg</filename>
  <source>
    <database>Unknown</database>
  </source>
  <size>
    <width>386</width>
    <height>257</height>
    <depth>3</depth>
  </size>
  <segmented>0</segmented>
  <object>
    <name>tank</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>80</xmin>
      <ymin>51</ymin>
      <xmax>357</xmax>
      <ymax>220</ymax>
    </bndbox>
  </object>
</annotation>

@wendq86看到这不起作用-您可以尝试仅将文件名放在没有路径的情况下,即<filename>000004.jpg</filename>并查看在尝试训练时是否会发生任何变化?

@abagshaw感谢您的建议。 我尝试在没有路径的情况下放置文件名,但仍然遇到相同的错误。

还有其他想法吗?

root<strong i="8">@154b72514519</strong>:/ml/darkflow# flow --model cfg/tiny-yolo-new.cfg --train --dataset "/ml/data/new/JPEGImages" --annotation "/ml/data/new/Annotations"

Parsing cfg/tiny-yolo-new.cfg
Loading None ...
Finished in 0.00011515617370605469s

Building net ...
Source | Train? | Layer description                | Output size
-------+--------+----------------------------------+---------------
       |        | input                            | (?, 416, 416, 3)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 416, 416, 16)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 208, 208, 16)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 208, 208, 32)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 104, 104, 32)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 104, 104, 64)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 52, 52, 64)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 52, 52, 128)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 26, 26, 128)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 26, 26, 256)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 13, 13, 256)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 512)
 Load  |  Yep!  | maxp 2x2p0_1                     | (?, 13, 13, 512)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Init  |  Yep!  | conv 1x1p0_1    linear           | (?, 13, 13, 40)
-------+--------+----------------------------------+---------------
Running entirely on CPU
cfg/tiny-yolo-new.cfg loss hyper-parameters:
    H       = 13
    W       = 13
    box     = 5
    classes = 3
    scales  = [1.0, 5.0, 1.0, 1.0]
Building cfg/tiny-yolo-new.cfg loss
Building cfg/tiny-yolo-new.cfg train op
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
Finished in 6.813853979110718s

Enter training ...

cfg/tiny-yolo-new.cfg parsing /ml/data/new/Annotations
Parsing for ['tank', 'truck', 'apc'] 
[====================>]100%  000296.xml
Statistics:
tank: 70
truck: 24
apc: 48
Dataset size: 130
Dataset of 130 instance(s)
Training statistics: 
    Learning rate : 1e-05
    Batch size    : 16
    Epoch number  : 1000
    Backup every  : 2000
step 1 - loss 105.96209716796875 - moving ave loss 105.96209716796875
step 2 - loss 105.95611572265625 - moving ave loss 105.9614990234375
step 3 - loss 105.87786865234375 - moving ave loss 105.95313598632812
Traceback (most recent call last):
  File "/usr/local/bin/flow", line 6, in <module>
    cliHandler(sys.argv)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/cli.py", line 29, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/flow.py", line 37, in train
    for i, (x_batch, datum) in enumerate(batches):
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolo/data.py", line 113, in shuffle
    inp, new_feed = self._batch(train_instance)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolov2/data.py", line 27, in _batch
    img = self.preprocess(path, allobj)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolo/predict.py", line 61, in preprocess
    result = imcv2_affine_trans(im)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/utils/im_transform.py", line 19, in imcv2_affine_trans
    h, w, c = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

@wendq86奇怪的是它在第一步没有出错......这可能表明某些.xml文件配置正确,而其他文件则没有? 您是否 100% 确定 _all_ 文件使用格式<filename>000004.jpg</filename> 。 是否有可能其中一个(或多个)配置不正确? 我不确定您是如何修改所有这些文件的格式的……但也许如果您使用工具批量修改大量文件,它可能会丢失一些文件?

我能想到的唯一另一件事是,也许某些图像已从/ml/data/new/JPEGImages中删除,但它们相应的.xml文件未从/ml/data/new/Annotations中删除? /ml/data/new/Annotations中的.xml文件数量是否与 $ /ml/data/new/JPEGImages中的图像数量相同?

我过去遇到过这种情况。 很有可能某些.xml.jpg文件没有正确命名/配置。 调试问题的一种方法是添加

print(jpg)

在此行之后: https ://github.com/thtrieu/darkflow/blob/master/darkflow/net/yolov2/data.py#L26

因此,您将能够看到损坏文件的名称并调查其.xml.jpg

感谢@abagshaw和@thtrieu! 我通过编写一个python脚本来解析xml文件来检查宽度、高度、ymin、ymax、xmin和xmax值,从而找到了问题的原因。 问题是由于opencv无法正确加载两个jpg文件,导致labelImg写入的xml文件中宽度和高度被指定为0。

@thtrieu的建议非常有帮助。 我没有使用 print 来找出问题 .jpg 或 .xml。
对于任何开始使用暗流的人,只想确保它是否适用于您的环境。 由于我提出的问题,我在这里做了一个小结论:

  1. 使用来自 darkflow-master/test/training/annotations 和 .../images 的数据,因此您无需考虑 VOCformat 工具。 您在这里有两个 .xml 文件。 (1.xml, 2.xml)
  2. 自己制作_test_labels.txt_,根据数据放三个类名(只有两张骑马和骑自行车的图片,类名可以从.xml中获取,打开查看即可)。

    自行车
  3. 更改 .cfg 文件中的 _classes_ nad _filters_ ,您必须更改 *.cfg 的名称,否则会出现其他问题,请勿更改您要使用的 .weights ,否则会出现其他问题。
  4. 运行以下代码以检查它是否在您的环境中运行。
    flow --model ../tiny-yolo-voc-try.cfg --load ../tiny-yolo-voc.weights --labels ../test_labels.txt --train --annotation ../annotations --dataset ../images --gpu 1.0

wendq86 你能和我们分享你的脚本吗?

我过去遇到过这种情况。 很有可能某些.xml.jpg文件没有正确命名/配置。 调试问题的一种方法是添加

print(jpg)

在此行之后: https ://github.com/thtrieu/darkflow/blob/master/darkflow/net/yolov2/data.py#L26

因此,您将能够看到损坏文件的名称并调查其.xml.jpg

如果是jpeg,我将如何解决问题? 我遇到了同样的问题并运行了打印语句。

我得到了这个输出:

cfg/yolov2-tiny-c1v2.cfg parsing lung_train/annotations
Parsing for ['Opacity']
[====================>]100%  012a5620-d082-4bb8-9b3b-e72d8938000c.xml
Statistics:
Opacity: 11
Dataset size: 6
Dataset of 6 instance(s)
**010ccb9f-6d46-4380-af11-84f87397a1b8.jpg
00c0b293-48e7-4e16-ac76-9269ba535a62**

我不知道这到底是什么意思,除了第二个图像文件后面没有 .jpg 。

Dataset size: 10
Dataset of 10 instance(s)
Traceback (most recent call last):
  File "flow", line 6, in <module>
    cliHandler(sys.argv)
  File "/content/darkflow/darkflow/cli.py", line 33, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "/content/darkflow/darkflow/net/flow.py", line 39, in train
    for i, (x_batch, datum) in enumerate(batches):
  File "/content/darkflow/darkflow/net/yolo/data.py", line 114, in shuffle
    inp, new_feed = self._batch(train_instance)
  File "/content/darkflow/darkflow/net/yolov2/data.py", line 28, in _batch
    img = self.preprocess(path, allobj)
  File "/content/darkflow/darkflow/net/yolo/predict.py", line 62, in preprocess
    result = imcv2_affine_trans(im)
  File "/content/darkflow/darkflow/utils/im_transform.py", line 20, in imcv2_affine_trans
    h, w, c = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

遇到此错误如何解决请帮助

@wendq86看到这不起作用-您可以尝试仅将文件名放在没有路径的情况下,即<filename>000004.jpg</filename>并查看在尝试训练时是否会发生任何变化?

这对我有用

嗨,当我想训练 COCO 数据集时,我遇到了同样的问题。 这是我解决此问题的方法:

  1. 我使用https://github.com/tylin/coco-dpm/blob/master/coco/convert_to_pascalformat.py将 COCO json 格式转换为 XML 格式。

  2. 但是我们需要修改脚本的某些部分,以确保这个新的 XML 文件的格式与 darkflow 示例中的 VOC XML 格式相同(darkflow/test/training/annotations)。 例如:
    第 1 步脚本中的 COCO XML 是:
    <tag1>
    xxxxx
    </tag1>
    <tag2>
    xxxxx
    </tag2>
    但我们需要如下格式:
    <tag1>xxxxx</tag>
    <tag2>xxxxx</tag2>

3 将 'label.txt' 文件中的 'tvmonitor' 更改为 'tv'

我删除了所有 jpeg 图像并且它有效

你好,

我正在训练一个新的数据集。 但是,训练总是跑几步,突然遇到如下错误:“AttributeError: 'NoneType' object has no attribute 'shape'”。 我认为注释文件中的注释格式和文件名是正确的,因为训练能够运行几个步骤并且正在运行有关如何进一步排除故障的想法。

感谢任何想法或帮助。

谢谢你。

root<strong i="10">@dd84391fd870</strong>:/ml/darkflow# flow --model cfg/tiny-yolo-new.cfg --train --dataset "../data/new/JPEGImages" --annotation "../data/new/Annotations"

Parsing cfg/tiny-yolo-new.cfg
Loading None ...
Finished in 0.00011324882507324219s

Building net ...
Source | Train? | Layer description                | Output size
-------+--------+----------------------------------+---------------
       |        | input                            | (?, 416, 416, 3)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 416, 416, 16)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 208, 208, 16)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 208, 208, 32)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 104, 104, 32)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 104, 104, 64)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 52, 52, 64)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 52, 52, 128)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 26, 26, 128)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 26, 26, 256)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 13, 13, 256)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 512)
 Load  |  Yep!  | maxp 2x2p0_1                     | (?, 13, 13, 512)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Init  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Init  |  Yep!  | conv 1x1p0_1    linear           | (?, 13, 13, 40)
-------+--------+----------------------------------+---------------
Running entirely on CPU
cfg/tiny-yolo-new.cfg loss hyper-parameters:
  H       = 13
  W       = 13
  box     = 5
  classes = 3
  scales  = [1.0, 5.0, 1.0, 1.0]
Building cfg/tiny-yolo-new.cfg loss
Building cfg/tiny-yolo-new.cfg train op
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
Finished in 7.207982778549194s

Enter training ...

cfg/tiny-yolo-new.cfg parsing ../data/new/Annotations
Parsing for ['tank', 'truck', 'apc'] 
[====================>]100%  000296.xml
Statistics:
apc: 48
tank: 70
truck: 24
Dataset size: 130
Dataset of 130 instance(s)
Training statistics: 
  Learning rate : 1e-05
  Batch size    : 16
  Epoch number  : 1000
  Backup every  : 2000
step 1 - loss 106.16172790527344 - moving ave loss 106.16172790527344
step 2 - loss 106.1773681640625 - moving ave loss 106.16329193115234
step 3 - loss 106.09341430664062 - moving ave loss 106.15630416870117
step 4 - loss 106.24054718017578 - moving ave loss 106.16472846984863
step 5 - loss 106.12216186523438 - moving ave loss 106.1604718093872
step 6 - loss 106.24075317382812 - moving ave loss 106.1684999458313
Traceback (most recent call last):
  File "/usr/local/bin/flow", line 6, in <module>
    cliHandler(sys.argv)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/cli.py", line 29, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/flow.py", line 37, in train
    for i, (x_batch, datum) in enumerate(batches):
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolo/data.py", line 113, in shuffle
    inp, new_feed = self._batch(train_instance)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolov2/data.py", line 27, in _batch
    img = self.preprocess(path, allobj)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/net/yolo/predict.py", line 61, in preprocess
    result = imcv2_affine_trans(im)
  File "/usr/local/lib/python3.5/dist-packages/darkflow/utils/im_transform.py", line 19, in imcv2_affine_trans
    h, w, c = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

删除所有 jpeg 图像

嗨,我正在尝试训练自定义对象检测来检测我的公司徽标,一切都很顺利,直到出现此错误,我还再次删除并注释了图像,但结果没有变化。 有人可以帮我解决这个问题吗
谢谢

(base) C:\Users\karanbari>cd Desktop/YOLO/darkflow-master

(base) C:\Users\karanbari\Desktop\YOLO\darkflow-master>python flow --model cfg/tiny-yolo-voc-1c.cfg --load bin/tiny-yolo-voc.weights --train --annotation annotations_clean --dataset images/train_clean --epoch 300
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1124 18:22:27.201594 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\build.py:15: The name tf.train.RMSPropOptimizer is deprecated. Please use tf.compat.v1.train.RMSPropOptimizer instead.

W1124 18:22:27.209591 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\build.py:16: The name tf.train.AdadeltaOptimizer is deprecated. Please use tf.compat.v1.train.AdadeltaOptimizer instead.

W1124 18:22:27.209591 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\build.py:17: The name tf.train.AdagradOptimizer is deprecated. Please use tf.compat.v1.train.AdagradOptimizer instead.

W1124 18:22:27.213590 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\build.py:18: The name tf.train.AdagradDAOptimizer is deprecated. Please use tf.compat.v1.train.AdagradDAOptimizer instead.

W1124 18:22:27.213590 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\build.py:19: The name tf.train.MomentumOptimizer is deprecated. Please use tf.compat.v1.train.MomentumOptimizer instead.


Parsing ./cfg/tiny-yolo-voc.cfg
Parsing cfg/tiny-yolo-voc-1c.cfg
Loading bin/tiny-yolo-voc.weights ...
Successfully identified 63471556 bytes
Finished in 0.019990205764770508s

Building net ...
W1124 18:22:27.253580 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\build.py:105: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

Source | Train? | Layer description                | Output size
-------+--------+----------------------------------+---------------
W1124 18:22:27.257580 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\ops\baseop.py:70: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

W1124 18:22:27.261598 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\ops\baseop.py:71: The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead.

W1124 18:22:27.277594 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\ops\baseop.py:84: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

       |        | input                            | (?, 416, 416, 3)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 416, 416, 16)
W1124 18:22:27.389549 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\ops\simple.py:106: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 208, 208, 16)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 208, 208, 32)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 104, 104, 32)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 104, 104, 64)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 52, 52, 64)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 52, 52, 128)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 26, 26, 128)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 26, 26, 256)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 13, 13, 256)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 512)
 Load  |  Yep!  | maxp 2x2p0_1                     | (?, 13, 13, 512)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 13, 13, 1024)
 Init  |  Yep!  | conv 1x1p0_1    linear           | (?, 13, 13, 30)
-------+--------+----------------------------------+---------------
Running entirely on CPU
cfg/tiny-yolo-voc-1c.cfg loss hyper-parameters:
        H       = 13
        W       = 13
        box     = 5
        classes = 1
        scales  = [1.0, 5.0, 1.0, 1.0]
W1124 18:22:29.962576 10144 deprecation.py:323] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolov2\train.py:87: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
Building cfg/tiny-yolo-voc-1c.cfg loss
W1124 18:22:30.010835 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolov2\train.py:107: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.

Building cfg/tiny-yolo-voc-1c.cfg train op
W1124 18:22:30.102793 10144 deprecation.py:323] From C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\ops\math_grad.py:1205: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W1124 18:22:32.038406 10144 deprecation.py:506] From C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\training\rmsprop.py:119: calling Ones.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
W1124 18:22:32.795700 10144 deprecation_wrapper.py:119] From C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\build.py:145: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2019-11-24 18:22:32.800843: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Finished in 11.774582862854004s

Enter training ...

cfg/tiny-yolo-voc-1c.cfg parsing annotations_clean
Parsing for ['vodafone']
[====================>]100%  Image9.xml
Statistics:
Dataset size: 53
Dataset of 53 instance(s)
Image20.jpg
Traceback (most recent call last):
  File "flow", line 6, in <module>
    cliHandler(sys.argv)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\cli.py", line 33, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\flow.py", line 39, in train
    for i, (x_batch, datum) in enumerate(batches):
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolo\data.py", line 114, in shuffle
    inp, new_feed = self._batch(train_instance)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolov2\data.py", line 28, in _batch
    img = self.preprocess(path, allobj)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolo\predict.py", line 62, in preprocess
    result = imcv2_affine_trans(im)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\utils\im_transform.py", line 20, in imcv2_affine_trans
    h, w, c = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

您的图像名称是否有特殊字符? 如果是这样,请更改它们。

2019 年 11 月 24 日星期日下午 6:32,karan bari [email protected]写道:

嗨,我正在尝试训练自定义对象检测来检测我的
公司徽标,在出现此错误之前一切顺利,我还删除了
再次注释图像,但结果没有变化。 有人可以请
帮我解决这个问题
谢谢

(基础)C:\Users\karanbari>cd Desktop/YOLO/darkflow-master

(基础)C:\Users\karanbari\Desktop\YOLOdarkflow-master>python flow --model cfg/tiny-yolo-voc-1c.cfg --load bin/tiny-yolo-voc.weights --train --annotation annotations_clean --数据集图像/train_clean --epoch 300
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:516: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:517: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:518: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:519: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:520: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:525: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
np_resource = np.dtype([("资源", np.ubyte, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:541: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:542: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:543: FutureWarning: Passing (type, 1) or '1type' 作为 type 的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:544: FutureWarning: Passing (type, 1) or '1type' 作为 type 的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:545: FutureWarning: Passing (type, 1) or '1type' 作为 type 的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:550: FutureWarning: Passing (type, 1) or '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。
np_resource = np.dtype([("资源", np.ubyte, 1)])
警告:标志解析前的日志记录进入标准错误。
W1124 18:22:27.201594 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:15:名称 tf.train.RMSPropOptimizer 已弃用。 请改用 tf.compat.v1.train.RMSPropOptimizer。

W1124 18:22:27.209591 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:16:名称 tf.train.AdadeltaOptimizer 已弃用。 请改用 tf.compat.v1.train.AdadeltaOptimizer。

W1124 18:22:27.209591 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:17:不推荐使用名称 tf.train.AdagradOptimizer。 请改用 tf.compat.v1.train.AdagradOptimizer。

W1124 18:22:27.213590 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:18:名称 tf.train.AdagradDAOptimizer 已弃用。 请改用 tf.compat.v1.train.AdagradDAOptimizer。

W1124 18:22:27.213590 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:19:名称 tf.train.MomentumOptimizer 已弃用。 请改用 tf.compat.v1.train.MomentumOptimizer。

解析./cfg/tiny-yolo-voc.cfg
解析cfg/tiny-yolo-voc-1c.cfg
正在加载 bin/tiny-yolo-voc.weights ...
成功识别63471556字节
0.019990205764770508s 完成

建筑网...
W1124 18:22:27.253580 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:105:名称 tf.placeholder 已弃用。 请改用 tf.compat.v1.placeholder。

来源 | 火车? | 层描述 | 输出尺寸
--------+--------+--------------------------------- -+---------------
W1124 18:22:27.257580 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:70:名称 tf.variable_scope 已弃用。 请改用 tf.compat.v1.variable_scope。

W1124 18:22:27.261598 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:71:名称 tf.get_variable 已弃用。 请改用 tf.compat.v1.get_variable。

W1124 18:22:27.277594 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:84:名称 tf.placeholder_with_default 已弃用。 请改用 tf.compat.v1.placeholder_with_default。

   |        | input                            | (?, 416, 416, 3)

加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 416, 416, 16)
W1124 18:22:27.389549 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\simple.py:106:不推荐使用名称 tf.nn.max_pool。 请改用 tf.nn.max_pool2d。

加载 | 是的! | 最大 2x2p0_2 | (?, 208, 208, 16)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 208, 208, 32)
加载 | 是的! | 最大 2x2p0_2 | (?, 104, 104, 32)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 104, 104, 64)
加载 | 是的! | 最大 2x2p0_2 | (?, 52, 52, 64)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 52, 52, 128)
加载 | 是的! | 最大 2x2p0_2 | (?, 26, 26, 128)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 26, 26, 256)
加载 | 是的! | 最大 2x2p0_2 | (?, 13, 13, 256)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 13, 13, 512)
加载 | 是的! | 最大 2x2p0_1 | (?, 13, 13, 512)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 13, 13, 1024)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 13, 13, 1024)
初始化 | 是的! | 转换 1x1p0_1 线性 | (?, 13, 13, 30)
--------+--------+--------------------------------- -+---------------
完全在 CPU 上运行
cfg/tiny-yolo-voc-1c.cfg 损失超参数:
H = 13
W = 13
框 = 5
类 = 1
尺度 = [1.0, 5.0, 1.0, 1.0]
W1124 18:22:29.962576 10144 deprecation.py:323] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2\train.py:87:to_float(来自 tensorflow.python.ops.math_ops)已弃用并将在未来的版本中删除。
更新说明:
请改用tf.cast
构建 cfg/tiny-yolo-voc-1c.cfg 损失
W1124 18:22:30.010835 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2\train.py:107:不推荐使用名称 tf.summary.scalar。 请改用 tf.compat.v1.summary.scalar。

构建cfg/tiny-yolo-voc-1c.cfg train op
W1124 18:22:30.102793 10144 deprecation.py:323] 来自 C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\ops\math_grad.py:1205:add_dispatch_support。.wrapper(来自 tensorflow.python.ops.array_ops)已被弃用,将在未来版本中删除。
更新说明:
使用 2.0 中的 tf.where,其广播规则与 np.where 相同
W1124 18:22:32.038406 10144 deprecation.py:506] 来自 C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\training\rmsprop.py:119:调用 Ones.__init__(来自 tensorflow.python dtype 的 .ops.init_ops) 已弃用,并将在未来版本中删除。
更新说明:
使用 dtype 参数调用初始化程序实例,而不是将其传递给构造函数
W1124 18:22:32.795700 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:145:名称 tf.Session 已弃用。 请改用 tf.compat.v1.Session。

2019-11-24 18:22:32.800843: I tensorflow/core/platform/cpu_feature_guard.cc:142] 您的 CPU 支持未编译此 TensorFlow 二进制文件以使用的指令:AVX2
11.774582862854004s 完成

进入培训...

cfg/tiny-yolo-voc-1c.cfg 解析 annotations_clean
解析 ['vodafone']
[====================>]100% Image9.xml
统计数据:
数据集大小:53
53 个实例的数据集
图片20.jpg
回溯(最近一次通话最后):
文件“流”,第 6 行,在
cliHandler(sys.argv)
cliHandler 中的文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\cli.py”,第 33 行
print('进入训练...'); tfnet.train()
文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\flow.py”,第 39 行,在火车中
对于 i, (x_batch, datum) in enumerate(batches):
文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolodata.py”,第 114 行,随机播放
inp, new_feed = self._batch(train_instance)
_batch 中的文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2data.py”,第 28 行
img = self.preprocess(路径,allobj)
文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolo\predict.py”,第 62 行,在预处理中
结果 = imcv2_affine_trans(im)
imcv2_affine_trans 中的文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflowutils\im_transform.py”,第 20 行
h, w, c = im.shape
AttributeError:“NoneType”对象没有属性“形状”


您收到此消息是因为您发表了评论。
直接回复此邮件,在 GitHub 上查看
https://github.com/thtrieu/darkflow/issues/265?email_source=notifications&email_token=AGG23MNSSXWIHQFI75KYEWDQVJ3ORA5CNFSM4DNJVSV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAKXNA#issuecomment-55788638
或退订
https://github.com/notifications/unsubscribe-auth/AGG23MMETFBN5NG76IHGWZ3QVJ3ORANCNFSM4DNJVSVQ
.

您的图像名称是否有特殊字符? 如果是这样,请更改它们。

2019 年 11 月 24 日星期日下午 6:32,karan bari @* > 写道:嗨,我正在尝试训练自定义对象检测来检测我的公司徽标,一切都很顺利,直到出现此错误,我还删除并再次注释了图像,但结果没有改变。 有人可以帮我吗 谢谢(基础) C:\Users\karanbari>cd Desktop/YOLO/darkflow-master(基础) C:\Users\karanbari\Desktop\YOLOdarkflow-master>python flow --model cfg/ tiny-yolo-voc-1c.cfg --load bin/tiny-yolo-voc.weights --train --annotation annotations_clean --dataset images/train_clean --epoch 300 C:\Users\karanbari\Anaconda3\lib\site -packages\tensorflow\python\frameworkdtypes.py:516:FutureWarning:不推荐将 (type, 1) 或 '1type' 作为类型的同义词传递; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:517: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:518: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:519: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:520: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:525: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 np_resource = np.dtype([("resource", np.ubyte, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:541: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:542: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:543: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:544: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:545: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:550: FutureWarning: Passing (type , 1) 或 '1type' 作为类型的同义词已被弃用; 在 numpy 的未来版本中,它将被理解为 (type, (1,)) / '(1,)type'。 np_resource = np.dtype([("resource", np.ubyte, 1)]) 警告:标志解析前的日志记录进入标准错误。 W1124 18:22:27.201594 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:15:名称 tf.train.RMSPropOptimizer 已弃用。 请改用 tf.compat.v1.train.RMSPropOptimizer。 W1124 18:22:27.209591 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:16:名称 tf.train.AdadeltaOptimizer 已弃用。 请改用 tf.compat.v1.train.AdadeltaOptimizer。 W1124 18:22:27.209591 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:17:不推荐使用名称 tf.train.AdagradOptimizer。 请改用 tf.compat.v1.train.AdagradOptimizer。 W1124 18:22:27.213590 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:18:名称 tf.train.AdagradDAOptimizer 已弃用。 请改用 tf.compat.v1.train.AdagradDAOptimizer。 W1124 18:22:27.213590 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:19:名称 tf.train.MomentumOptimizer 已弃用。 请改用 tf.compat.v1.train.MomentumOptimizer。 正在解析 ./cfg/tiny-yolo-voc.cfg 正在解析 cfg/tiny-yolo-voc-1c.cfg 正在加载 bin/tiny-yolo-voc.weights ... 成功识别 63471556 字节 0.019990205764770508s 完成构建网 ... W1124 18:22:27.253580 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:105:名称 tf.placeholder 已弃用。 请改用 tf.compat.v1.placeholder。 来源 | 火车? | 层描述 | 输出大小 --------+--------+-------------------------------- ---+--------------- W1124 18:22:27.257580 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\ baseop.py:70:不推荐使用名称 tf.variable_scope。 请改用 tf.compat.v1.variable_scope。 W1124 18:22:27.261598 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:71:名称 tf.get_variable 已弃用。 请改用 tf.compat.v1.get_variable。 W1124 18:22:27.277594 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:84:名称 tf.placeholder_with_default 已弃用。 请改用 tf.compat.v1.placeholder_with_default。 | | 输入 | (?, 416, 416, 3) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 416, 416, 16) W1124 18:22:27.389549 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\simple.py:106:名称 tf. nn.max_pool 已弃用。 请改用 tf.nn.max_pool2d。 加载 | 是的! | 最大 2x2p0_2 | (?, 208, 208, 16) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 208, 208, 32) 加载 | 是的! | 最大 2x2p0_2 | (?, 104, 104, 32) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 104, 104, 64) 加载 | 是的! | 最大 2x2p0_2 | (?, 52, 52, 64) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 52, 52, 128) 加载 | 是的! | 最大 2x2p0_2 | (?, 26, 26, 128) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 26, 26, 256) 加载 | 是的! | 最大 2x2p0_2 | (?, 13, 13, 256) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 13, 13, 512) 加载 | 是的! | 最大 2x2p0_1 | (?, 13, 13, 512) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 13, 13, 1024) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 13, 13, 1024) 初始化 | 是的! | 转换 1x1p0_1 线性 | (?, 13, 13, 30) -------+--------+------------------------ ----------+---------------- 完全在 CPU 上运行 cfg/tiny-yolo-voc-1c.cfg 损失超参数:H = 13 W = 13 个框 = 5 个类 = 1 个比例 = [1.0, 5.0, 1.0, 1.0] W1124 18:22:29.962576 10144 deprecation.py:323] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2\ train.py:87:to_float(来自 tensorflow.python.ops.math_ops)已弃用,将在未来版本中删除。 更新说明:改用tf.cast 。 Building cfg/tiny-yolo-voc-1c.cfg loss W1124 18:22:30.010835 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2\train.py:107:名称 tf.summary.scalar 已弃用。 请改用 tf.compat.v1.summary.scalar。 Building cfg/tiny-yolo-voc-1c.cfg train op W1124 18:22:30.102793 10144 deprecation.py:323] 来自 C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\ops\math_grad .py:1205:add_dispatch_support。.wrapper(来自 tensorflow.python.ops.array_ops)已被弃用,将在未来版本中删除。 更新说明:使用 2.0 中的 tf.where,与 np.where 具有相同的广播规则 W1124 18:22:32.038406 10144 deprecation.py:506] From C:\Users\karanbari\Anaconda3\lib\site-packages\ tensorflow\python\training\rmsprop.py:119:使用 dtype 调用 Ones.__init__(来自 tensorflow.python.ops.init_ops)已被弃用,将在未来版本中删除。 更新说明:使用 dtype 参数调用初始化程序实例,而不是将其传递给构造函数 W1124 18:22:32.795700 10144 deprecation_wrapper.py:119] 来自 C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py :145: 名称 tf.Session 已弃用。 请改用 tf.compat.v1.Session。 2019-11-24 18:22:32.800843: I tensorflow/core/platform/cpu_feature_guard.cc:142] 您的 CPU 支持未编译此 TensorFlow 二进制文件以使用的指令:AVX2 Finished in 11.774582862854004s Enter training ... cfg/ tiny-yolo-voc-1c.cfg 解析 annotations_clean 解析 ['vodafone'] [====================>]100% Image9.xml 统计:数据集大小: 53 个实例的 53 个数据集 Image20.jpg Traceback(最近一次调用最后一次):文件“流”,第 6 行,在cliHandler(sys.argv) 文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\cli.py”,第 33 行,在 cliHandler print('Enter training ...'); tfnet.train() 文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\flow.py”,第 39 行,在 i 的训练中,(x_batch, datum) in enumerate(batches):文件“C: \Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolodata.py”,第 114 行,在 shuffle inp 中,new_feed = self._batch(train_instance) 文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ yolov2data.py”,第 28 行,在 _batch img = self.preprocess(path, allobj) 文件“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolo\predict.py”,第 62 行,在预处理结果中= imcv2_affine_trans(im) 文件 "C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflowutils\im_transform.py",第 20 行,在 imcv2_affine_trans h, w, c = im.shape AttributeError: 'NoneType' 对象没有属性 'shape ' - 您收到此消息是因为您发表了评论。 回复此电子邮件直接,查看它在GitHub <#265?email_source =通知&email_token = AGG23MNSSXWIHQFI75KYEWDQVJ3ORA5CNFSM4DNJVSV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAKXNA#issuecomment-557886388>,或取消订阅https://github.com/notifications/unsubscribe-auth/AGG23MMETFBN5NG76IHGWZ3QVJ3ORANCNFSM4DNJVSVQ

不,我已经重新命名了 Image1、Image2、Image3... 等格式的所有图像,并且所有图像都具有 .jpg 格式

您的注释维度之一很可能小于
0 或超出图像。

还要检查您是否可以手动打开所有图像。

2019 年 11 月 24 日星期日下午 6:42,karan bari [email protected]写道:

您的图像名称是否有特殊字符? 如果是这样,请更改它们。
… <#m_-6851739743886041955_>
2019 年 11 月 24 日星期日下午 6:32,karan bari @* > 写道:嗨,我是
尝试训练自定义对象检测来检测我的公司徽标,
在出现此错误之前一切顺利,我还删除并注释了图像
再次,但结果没有改变。 有人可以帮我解决这个问题吗
谢谢(基础) C:\Users\karanbari>cd Desktop/YOLO/darkflow-master(基础)
C:\Users\karanbari\Desktop\YOLOdarkflow-master>python 流 --model
cfg/tiny-yolo-voc-1c.cfg --load bin/tiny-yolo-voc.weights --train
--annotation annotations_clean --dataset images/train_clean --epoch 300
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:516:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:517:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:518:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:519:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:520:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\frameworkdtypes.py:525:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 np_resource = np.dtype([("资源", np.ubyte, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:541:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:542:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:543:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:544:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:545:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorboard\compat\tensorflow_stubdtypes.py:550:
FutureWarning:传递 (type, 1) 或 '1type' 作为类型的同义词是
已弃用; 在 numpy 的未来版本中,它将被理解为 (type,
(1,)) / '(1,) 类型'。 np_resource = np.dtype([("资源", np.ubyte, 1)])
警告:标志解析前的日志记录进入标准错误。 W1124 18:22:27.201594
10144 deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:15:
名称 tf.train.RMSPropOptimizer 已弃用。 请用
tf.compat.v1.train.RMSPropOptimizer 代替。 W1124 18:22:27.209591 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:16:
名称 tf.train.AdadeltaOptimizer 已弃用。 请用
tf.compat.v1.train.AdadeltaOptimizer 代替。 W1124 18:22:27.209591 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:17:
名称 tf.train.AdagradOptimizer 已弃用。 请用
tf.compat.v1.train.AdagradOptimizer 代替。 W1124 18:22:27.213590 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:18:
名称 tf.train.AdagradDAOptimizer 已弃用。 请用
tf.compat.v1.train.AdagradDAOptimizer 代替。 W1124 18:22:27.213590 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:19:
名称 tf.train.MomentumOptimizer 已弃用。 请用
tf.compat.v1.train.MomentumOptimizer 代替。 解析
./cfg/tiny-yolo-voc.cfg 解析 cfg/tiny-yolo-voc-1c.cfg 加载中
bin/tiny-yolo-voc.weights ... 成功识别63471556字节
完成于0.019990205764770508s 楼网... W1124 18:22:27.253580
10144 deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:105:
名称 tf.placeholder 已弃用。 请使用 tf.compat.v1.placeholder
反而。 来源 | 火车? | 层描述 | 输出尺寸
--------+--------+--------------------------------- -+--------------- W1124
18:22:27.257580 10144 deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:70:
名称 tf.variable_scope 已弃用。 请用
tf.compat.v1.variable_scope 代替。 W1124 18:22:27.261598 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:71:
名称 tf.get_variable 已弃用。 请用
tf.compat.v1.get_variable 代替。 W1124 18:22:27.277594 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\baseop.py:84:
名称 tf.placeholder_with_default 已弃用。 请用
tf.compat.v1.placeholder_with_default 代替。 | | 输入 | (?, 416, 416, 3)
加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 416, 416, 16) W1124
18:22:27.389549 10144 deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\ops\simple.py:106:
名称 tf.nn.max_pool 已弃用。 请改用 tf.nn.max_pool2d。
加载 | 是的! | 最大 2x2p0_2 | (?, 208, 208, 16) 加载 | 是的! | 转化率 3x3p1_1
+正常泄漏 | (?, 208, 208, 32) 加载 | 是的! | 最大 2x2p0_2 | (?, 104, 104,
32) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 104, 104, 64) 加载 | 是的!
| 最大 2x2p0_2 | (?, 52, 52, 64) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 |
(?, 52, 52, 128) 加载 | 是的! | 最大 2x2p0_2 | (?, 26, 26, 128) 加载 | 是的!
| 转换 3x3p1_1 +bnorm 泄漏 | (?, 26, 26, 256) 加载 | 是的! | 最大 2x2p0_2 |
(?, 13, 13, 256) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 | (?, 13, 13, 512)
加载 | 是的! | 最大 2x2p0_1 | (?, 13, 13, 512) 加载 | 是的! | 转化率 3x3p1_1
+正常泄漏 | (?, 13, 13, 1024) 加载 | 是的! | 转换 3x3p1_1 +bnorm 泄漏 |
(?, 13, 13, 1024) 初始化 | 是的! | 转换 1x1p0_1 线性 | (?, 13, 13, 30)
--------+--------+--------------------------------- -+--------------- 正在运行
完全基于 CPU cfg/tiny-yolo-voc-1c.cfg 损失超参数:H = 13 W =
13 个框 = 5 个类别 = 1 个比例 = [1.0, 5.0, 1.0, 1.0] W1124 18:22:29.962576
10144 deprecation.py:323]来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2\train.py:87:
to_float(来自 tensorflow.python.ops.math_ops)已被弃用,并将被
在未来的版本中删除。 更新说明:使用 tf.cast
反而。 构建cfg/tiny-yolo-voc-1c.cfg loss W1124 18:22:30.010835 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2\train.py:107:
名称 tf.summary.scalar 已弃用。 请用
tf.compat.v1.summary.scalar 代替。 构建 cfg/tiny-yolo-voc-1c.cfg
训练操作 W1124 18:22:30.102793 10144 deprecation.py:323] 从
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\ops\math_grad.py:1205:
add_dispatch_support..wrapper (来自 tensorflow.python.ops.array_ops)是
已弃用,并将在未来的版本中删除。 说明
更新:使用 2.0 中的 tf.where,与广播规则相同
np.where W1124 18:22:32.038406 10144 deprecation.py:506] 来自
C:\Users\karanbari\Anaconda3\lib\site-packages\tensorflow\python\training\rmsprop.py:119:
打电话给那些。 具有 dtype 的init (来自 tensorflow.python.ops.init_ops)是
已弃用,并将在未来的版本中删除。 说明
更新:使用 dtype 参数而不是调用初始化程序实例
将其传递给构造函数 W1124 18:22:32.795700 10144
deprecation_wrapper.py:119] 来自
C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\build.py:145:
名称 tf.Session 已弃用。 请改用 tf.compat.v1.Session。
2019-11-24 18:22:32.800843: 我
tensorflow/core/platform/cpu_feature_guard.cc:142] 你的 CPU 支持
此 TensorFlow 二进制文件未编译使用的指令:AVX2
11.774582862854004s 完成进入训练...cfg/tiny-yolo-voc-1c.cfg
解析 annotations_clean 解析 ['vodafone']
[====================>]100% Image9.xml 统计:数据集大小:53 数据集
53 个实例的 Image20.jpg Traceback(最近一次调用最后一次):文件
“流”,第 6 行,在 cliHandler(sys.argv) 文件中
“C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\cli.py”,第 33 行,
在 cliHandler print('进入训练...'); tfnet.train() 文件
"C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\flow.py",
第 39 行,在 i 的训练中,(x_batch, datum) in enumerate(batches): File
"C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolodata.py",
第 114 行,在 shuffle inp 中,new_feed = self._batch(train_instance) 文件
"C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolov2data.py",
第 28 行,在 _batch img = self.preprocess(path, allobj) 文件中
"C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflow\net\yolo\predict.py",
第 62 行,在预处理结果 = imcv2_affine_trans(im) 文件中
"C:\Users\karanbari\Desktop\YOLOdarkflow-masterdarkflowutils\im_transform.py",
第 20 行,在 imcv2_affine_trans h, w, c = im.shape AttributeError 中:
'NoneType' 对象没有属性 'shape' - 你收到这个是因为
你评论了。 直接回复此邮件,在 GitHub 上查看 <#265
https://github.com/thtrieu/darkflow/issues/265 ?email_source=notifications&email_token=AGG23MNSSXWIHQFI75KYEWDQVJ3ORA5CNFSM4DNJVSV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAKXNA#issuecomment-557888>33
或退订
https://github.com/notifications/unsubscribe-auth/AGG23MMETFBN5NG76IHGWZ3QVJ3ORANCNFSM4DNJVSVQ
.

不,我已经重新命名了 Image1、Image2、Image3... 等格式的所有图像
并且所有图像都有.jpg格式


您收到此消息是因为您发表了评论。
直接回复此邮件,在 GitHub 上查看
https://github.com/thtrieu/darkflow/issues/265?email_source=notifications&email_token=AGG23MJ2SKBIF2FQTPTLBRLQVJ4SVA5CNFSM4DNJVSV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAK5PQ#issuecomment-55788
或退订
https://github.com/notifications/unsubscribe-auth/AGG23ML6HYW6S7JZEN2ZAF3QVJ4SVANCNFSM4DNJVSVQ
.

这次我再次使用 labelImg 对图像进行了注释,问题仍然存在。

Enter training ...

cfg/tiny-yolo-voc-1c.cfg parsing annotations_clean
Parsing for ['vodafone']
[====================>]100%  Image8.xml
Statistics:
vodafone: 59
Dataset size: 51
Dataset of 51 instance(s)
**Image7.jpg**
Traceback (most recent call last):
  File "flow", line 6, in <module>
    cliHandler(sys.argv)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\cli.py", line 33, in cliHandler
    print('Enter training ...'); tfnet.train()
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\flow.py", line 39, in train
    for i, (x_batch, datum) in enumerate(batches):
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolo\data.py", line 114, in shuffle
    inp, new_feed = self._batch(train_instance)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolov2\data.py", line 28, in _batch
    img = self.preprocess(path, allobj)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\net\yolo\predict.py", line 62, in preprocess
    result = imcv2_affine_trans(im)
  File "C:\Users\karanbari\Desktop\YOLO\darkflow-master\darkflow\utils\im_transform.py", line 20, in imcv2_affine_trans
    h, w, c = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

这里再次出现错误和 Image7.jpg 的相应 .xml 文件

<annotation>
    <folder>train_clean</folder>
    <filename>Image7.jpg</filename>
    <path>C:\Users\karanbari\Desktop\YOLO\images\train_clean\Image7.jpg</path>
    <source>
        <database>Unknown</database>
    </source>
    <size>
        <width>1300</width>
        <height>1390</height>
        <depth>3</depth>
    </size>
    <segmented>0</segmented>
    <object>
        <name>vodafone</name>
        <pose>Unspecified</pose>
        <truncated>0</truncated>
        <difficult>0</difficult>
        <bndbox>
            <xmin>370</xmin>
            <ymin>258</ymin>
            <xmax>916</xmax>
            <ymax>792</ymax>
        </bndbox>
    </object>
</annotation>

最好放
print(im, type(im))
在 L58 的 darkflow/net/yolo/predict.py 中并自行检查路径

有同样的错误

我面临同样的问题,我的解决方法是:
在 predict.py line# 60中将 im = cv2.imread(im)更改为im = cv2.imread(im+'.jpg')

我有同样的问题,这是因为我删除了 jpg 图像但忘记删除它的注释。 所以请确保图像及其注释是一致的。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

zhisong picture zhisong  ·  22评论

wkdhkr picture wkdhkr  ·  32评论

jiankang1991 picture jiankang1991  ·  22评论

ramarajan09 picture ramarajan09  ·  35评论

y22ma picture y22ma  ·  46评论