Coder Social home page Coder Social logo

Comments (17)

marphil avatar marphil commented on August 16, 2024 31

Hi,
I have also encountered this error. Seems like something is wrong in at least one of the annotations, an artificial solution is the following: in imdb.py

for b in range(len(boxes)):     
                if boxes[b][2] < boxes[b][0]:
                   boxes[b][0] = 0

assert (boxes[:, 2] >= boxes[:, 0]).all()

Hope this helps!

from py-faster-rcnn.

DiegoPortoJaccottet avatar DiegoPortoJaccottet commented on August 16, 2024 5

Hello yawadugyamfi, did you find a solution to your error? Would you share it with us please?

Never mind, I found the answer. There should be no <ymin>0</ymin> nor <xmin>0</xmin> in an object.

I changed that in the Annotations folder with the two commands (./ means the current folder is Annotations):
grep -rl '<ymin>0</ymin>' ./ | xargs sed -i 's#<ymin>0</ymin>#<ymin>1</ymin>#g'
and
grep -rl '<xmin>0</xmin>' ./ | xargs sed -i 's#<xmin>0</xmin>#<xmin>1</xmin>#g'

Now training is running smoothly. .

from py-faster-rcnn.

moyans avatar moyans commented on August 16, 2024

@marphil I get the following error:
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(_self._args, *_self._kwargs)
File "./tools/train_faster_rcnn_alt_opt.py", line 122, in train_rpn
roidb, imdb = get_roidb(imdb_name)
File "./tools/train_faster_rcnn_alt_opt.py", line 67, in get_roidb
roidb = get_training_roidb(imdb)
File "/media/dl/c0d34b51-8a78-4364-bc19-35003bf01885/RCNN/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 118, in get_training_roidb
imdb.append_flipped_images()
File "/media/dl/c0d34b51-8a78-4364-bc19-35003bf01885/RCNN/py-faster-rcnn/tools/../lib/datasets/imdb.py", line 106, in append_flipped_images
boxes = self.roidb[i]['boxes'].copy()
File "/media/dl/c0d34b51-8a78-4364-bc19-35003bf01885/RCNN/py-faster-rcnn/tools/../lib/datasets/imdb.py", line 67, in roidb
self._roidb = self.roidb_handler()
File "/media/dl/c0d34b51-8a78-4364-bc19-35003bf01885/RCNN/py-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 103, in gt_roidb
for index in self.image_index]
File "/media/dl/c0d34b51-8a78-4364-bc19-35003bf01885/RCNN/py-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 204, in _load_pascal_annotation
x1 = float(bbox.find('xmin').text)
ValueError: invalid literal for float(): 737,

from py-faster-rcnn.

aragon111 avatar aragon111 commented on August 16, 2024

@marphil in which function you wrote those lines?

from py-faster-rcnn.

aragon111 avatar aragon111 commented on August 16, 2024

@DiegoPortoJaccottet I got sed: no input files

from py-faster-rcnn.

alviur avatar alviur commented on August 16, 2024

@marphil that worked for me!.

from py-faster-rcnn.

CWOA avatar CWOA commented on August 16, 2024

@DiegoPortoJaccottet your fix worked for me, thanks! The @marphil fix produces the same assertion error in my case.

from py-faster-rcnn.

harora avatar harora commented on August 16, 2024

@DiegoPortoJaccottet Even i got sed : no input files. I have my annotation files in that folder ( *.xml)

from py-faster-rcnn.

DiegoPortoJaccottet avatar DiegoPortoJaccottet commented on August 16, 2024

@harora
You got 'sed: no input files' from the commands I described or from Faster-RCNN?

from py-faster-rcnn.

XiangyuChu avatar XiangyuChu commented on August 16, 2024

@moyans I get the same error with you.

y2= float(bbox.find('ymax').text)
ValueError: invalid literal for float(): 196006001002176.jpg

Have you found any solution to it? Thank you

from py-faster-rcnn.

moyans avatar moyans commented on August 16, 2024

from py-faster-rcnn.

XiangyuChu avatar XiangyuChu commented on August 16, 2024

@moyans 196006001002176.jpg is very odd. My images are usually "000000.jpg", same as VOC2007.
And I have removed "-1" from the lines below
x1 = float(bbox.find( 'xmin').text)
y1 = float(bbox.find('ymin').text)
x2 = float(bbox.find('xmax').text)
y2 = float(bbox.find('ymax').text)

from py-faster-rcnn.

moyans avatar moyans commented on August 16, 2024

from py-faster-rcnn.

firestonelib avatar firestonelib commented on August 16, 2024

in the Annotation folder I run
grep -rl '<ymin>0</ymin>' ./ | xargs sed -i 's#<ymin>0</ymin>#<ymin>1</ymin>#g'
I got: sed : no input files just like @harora . I want to know why. @DiegoPortoJaccottet

from py-faster-rcnn.

XiangyuChu avatar XiangyuChu commented on August 16, 2024

@moyans Thanks for your help. I have solved the error. I found an error in "output.txt", i.e. 002175.jpg c 669 155 769 **196006001002176.jpg p 207 188 229 257. What puzzles me is that I cannot find error in .xml. Anyway, it is solved. Thank you again!

from py-faster-rcnn.

iamlxb3 avatar iamlxb3 commented on August 16, 2024

I replaced xmin 0 and ymin 0 with xmin 1 and ymin 1, all things resolved!

see more #34

from py-faster-rcnn.

ankitcsr avatar ankitcsr commented on August 16, 2024

in the Annotation folder I run
grep -rl '<ymin>0</ymin>' ./ | xargs sed -i 's#<ymin>0</ymin>#<ymin>1</ymin>#g'
I got: sed : no input files just like @harora . I want to know why. @DiegoPortoJaccottet

replace 0 with 0.0

from py-faster-rcnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.