Run Faster-RCNN-TensorFlow-Python3.5 train.py file appears to assert (boxes [:, 2]> = boxes [:, 0]). All () Error

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

Reference article: https://blog.csdn.net/10km/article/details/64641322
I think my xml file does not need to have a rectangular frame minus 1, so all in front of -1 plus a pound, the - 1 are commented out.
Error: File "/home/drl/new/Faster-RCNN-TensorFlow-Python3.5/lib/datasets/imdb.py", line 119, in append_flipped_images assert (boxes[:, 2] >= boxes[:, 0]).all()
Here Insert Picture DescriptionThe solution is: will /home/drl/new/Faster-RCNN-TensorFlow-Python3.5/lib/datasets/pascal_voc.py open, the 162-165 line after the code of -1 are commented out! ! !
Here Insert Picture DescriptionWhen re-run train.py file, first
1, while all models /home/drl/new/Faster-RCNN-TensorFlow-Python3.5/default/voc_2007_trainval/ file folder backup, then delete
2, also To backup cache file under /home/drl/new/Faster-RCNN-TensorFlow-Python3.5/data/cache/ folder, and then delete

Then runpython train.py

Here Insert Picture DescriptionHere Insert Picture Description
success!

Training finished, now run demo.py file, at the command line enter the code python demo.py
error:

  File "/home/drl/anaconda3/envs/tensorflow-gpu/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1204, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [21] rhs shape= [2]
	 [[Node: save/Assign_2 = Assign[T=DT_FLOAT, _class=["loc:@vgg_16/cls_score/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](vgg_16/cls_score/biases, save/RestoreV2_2/_5)]]

Here Insert Picture DescriptionHere Insert Picture DescriptionError reason is:
1. did not demo.py the code, line 33 rows into their own category:
Here Insert Picture Description
2. did not demo.py the code, line 33 rows need to test the image name was changed to the name of the picture you want to test yourself:
Here Insert Picture Description
read:

Here Insert Picture Description
3. There is no need to test their own pictures placed in the folder /home/drl/new/Faster-RCNN-TensorFlow-Python3.5/data/demo/

Here Insert Picture Description
Read:

Here Insert Picture DescriptionThen re-run demo.py file:

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/kellyroslyn/article/details/93626471