Giter VIP home page Giter VIP logo

Comments (9)

yuyu2172 avatar yuyu2172 commented on July 27, 2024

Here is a train code.
You can train with you own dataset by changing the dataset used in the code from VOC to yours.

https://github.com/chainer/chainercv/blob/master/examples/faster_rcnn/train.py

from chainercv.

HIN0209 avatar HIN0209 commented on July 27, 2024

Thank you for the reply.
For the sake of other people who have similar questions (I have seen many such inquiries in other github codes, but so many with incomplete answers), could you clarify the points?

In train.py, lines 62-64:
train_data = VOCDetectionDataset(split='trainval', year='2007')
test_data = VOCDetectionDataset(split='test', year='2007',
use_difficult=True, return_difficult=True)

Are these the portion that needs to be changed? If yes, should I just specify the path to the train_data and test_data instead?

Thank you for helping!

from chainercv.

yuyu2172 avatar yuyu2172 commented on July 27, 2024

Yes, as you said, these are the lines that you need to change.
Your detection dataset should return three objects when indexed: img, bbox and label.
It is important that the shape and convention used in your dataset are consistent with ChainerCV.
Please check this.
https://github.com/chainer/chainercv#data-conventions

Also, the label_names is probably different with your dataset, so you need to change that too.
https://github.com/chainer/chainercv/blob/master/examples/faster_rcnn/train.py#L124
https://github.com/chainer/chainercv/blob/master/examples/faster_rcnn/train.py#L65

from chainercv.

HIN0209 avatar HIN0209 commented on July 27, 2024

Thank you for the info. Let me try these.

from chainercv.

HIN0209 avatar HIN0209 commented on July 27, 2024

Hello,
I tried faster RCNN with my own dataset (Ubuntu 14.04, anaconda=4.2.16 that created an env, chainer=2.0.1, chainercv=0.6.0, numpy=1.13.1, cupy=1.0.0.1).

I replaced one class of VOC2012 with my own class. The training went fine until iteration 3000 when there was an error message as shown below. Multiple trials yielded the same error, even after changing the plot_interval (in train.py) from 3000 to 10000. Is this a numpy error?

--------------------------------------error message below
2980 0 613.412 0.001 1.0425 0.34825 0.417773 0.0704124 0.206067
Process Process-12:...........................................] 4.27%
Traceback (most recent call last):............................] 25.91%
File "/home/owner/anaconda3/envs/chainercv/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()rs/sec. Estimated time to finish: 3:51:27.651041.
File "/home/owner/anaconda3/envs/chainercv/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/owner/anaconda3/envs/chainercv/lib/python3.5/site-packages/chainer/iterators/multiprocess_iterator.py", line 390, in _worker
data = _pack(dataset[index], mem)
File "/home/owner/anaconda3/envs/chainercv/lib/python3.5/site-packages/chainercv/datasets/transform_dataset.py", line 54, in getitem
in_data = self._dataset[index]
File "/home/owner/anaconda3/envs/chainercv/lib/python3.5/site-packages/chainer/dataset/dataset_mixin.py", line 67, in getitem
return self.get_example(index)
File "/home/owner/anaconda3/envs/chainercv/lib/python3.5/site-packages/chainercv/datasets/voc/voc_detection_dataset.py", line 138, in get_example
bbox = np.stack(bbox).astype(np.float32)
File "/home/owner/anaconda3/envs/chainercv/lib/python3.5/site-packages/numpy/core/shape_base.py", line 350, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack

from chainercv.

Hakuyume avatar Hakuyume commented on July 27, 2024

There may be an image without any ground truth bounding boxes. Please make sure that each training image has at least one annotation.

from chainercv.

yuyu2172 avatar yuyu2172 commented on July 27, 2024

Yeah, as @Hakuyume said, you have an image with no annotation.
You can make it work by filtering all images without annotations from the dataset.

from chainercv.

HIN0209 avatar HIN0209 commented on July 27, 2024

Thank you both for the comment! I will carefully check the files.

from chainercv.

yuyu2172 avatar yuyu2172 commented on July 27, 2024

Continued discussion in #391

from chainercv.

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.