deep-vision icon indicating copy to clipboard operation
deep-vision copied to clipboard

Training on my own dataset

Open eliwilner opened this issue 5 years ago • 3 comments

Hi Ethan,

Great work, I was wondering, if I have my own data with lets say 4 classes, should I just changed TOTAL_CLASSES = 4 on train.py and I would be able to run it?

Thanks

eliwilner avatar Jan 14 '20 17:01 eliwilner

Do you mean YOLOv3? yes, for the training script itself, you just need to change to TOTAL_CLASSES=4. However my implementation uses TF Records so you'll also need to make sure your data is ready in that format.

ethanyanjiali avatar Jan 14 '20 20:01 ethanyanjiali

Hello Again.

Thanks for replying. For some reason I get the following error when I tried to train

Traceback (most recent call last): File "train.py", line 317, in main() File "train.py", line 296, in main shape=(416, 416, 3), num_classes=TOTAL_CLASSES, training=True) File "/home/ubuntu/yolo/yolov3.py", line 152, in YoloV3 x = Concatenate(name='detector_scale_1_concat')([x, x_medium]) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 817, in call self._maybe_build(inputs) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 2141, in _maybe_build self.build(input_shapes) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow_core/python/keras/utils/tf_utils.py", line 306, in wrapper output_shape = fn(instance, input_shape) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow_core/python/keras/layers/merge.py", line 391, in build 'Got inputs shapes: %s' % (input_shape)) ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 256, 26, 2), (None, 512, 26, 1)]

Any idea why this is happening?

On Tue, Jan 14, 2020 at 3:45 PM Ethan Yanjia Li [email protected] wrote:

Do you mean YOLOv3? yes, for the training script itself, you just need to change to TOTAL_CLASSES=4. However my implementation uses TF Records so you'll also need to make sure your data is ready in that format.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ethanyanjiali/deep-vision/issues/2?email_source=notifications&email_token=ANCPHGCJXVICPEFZG35H2HLQ5YP7NA5CNFSM4KGWY7ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI6CBAY#issuecomment-574365827, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANCPHGFXS3YZCQTX2E7QLVLQ5YP7NANCNFSM4KGWY7ZA .

-- E.

eliwilner avatar Jan 14 '20 21:01 eliwilner

seems like the input shape is wrong during the concatenation in the detection head. the part i don't quite understand is that why x and x_medium could have shape of [(None, 256, 26, 2), (None, 512, 26, 1)], it supposed to be 26x26x256 and 26x26x512. did you set the input to be channel first?

ethanyanjiali avatar Jan 15 '20 19:01 ethanyanjiali