Skip to content

Commit

Permalink
train bdd detection in coco format (#8)
Browse files Browse the repository at this point in the history
* train bdd detection in coco format

* Update coco.py

* Gradient clipping
  • Loading branch information
haofengac authored Mar 17, 2019
1 parent 534ec22 commit 1c8c931
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion maskrcnn_benchmark/config/paths_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class DatasetCatalog(object):
"bdd100k_val": (
"bdd100k/images/100k/val", "bdd100k/labels/bdd100k_labels_images_val.json"
),
"bdd100k_det_train": (
"bdd100k/images/100k/train", "bdd100k/labels/bdd100k_labels_images_det_coco_train.json"
),
"bdd100k_det_val": (
"bdd100k/images/100k/val", "bdd100k/labels/bdd100k_labels_images_det_coco_val.json"
),
"kitti_tracking_train": (
"kitti_tracking/train", ""
),
Expand All @@ -46,7 +52,7 @@ def get(name):
factory_names = {
"coco": "COCODataset",
"kitti": "KittiDataset",
"bdd100k": "Bdd100kDataset"
"bdd100k": "COCODataset"
}
for k in factory_names.keys():
if (k in name):
Expand Down
7 changes: 7 additions & 0 deletions maskrcnn_benchmark/engine/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ def do_train(

optimizer.zero_grad()
losses.backward()

accum_grad = 0
for p in list(filter(lambda p: p.grad is not None, model.parameters())):
accum_grad += p.grad.data.norm(2).item()

if iteration > 500 and accum_grad > 200:
torch.nn.utils.clip_grad_norm_(model.parameters(), 200)
optimizer.step()

batch_time = time.time() - end
Expand Down

2 comments on commit 1c8c931

@vikki1234-cloud
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Vikki here I am from Mumbai VJTI college please help me I want the " bdd100k_labels_images_train.json "file please send it me on binnarvikki@gmail.com
please reply to me as soon as possible

@kkhgoo
Copy link

@kkhgoo kkhgoo commented on 1c8c931 Nov 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Vikki here I am from Mumbai VJTI college please help me I want the " bdd100k_labels_images_train.json "file please send it me on binnarvikki@gmail.com please reply to me as soon as possible

Hello, did you get the file? Could you please share? I am desperate
I'm struggling with the different format of the mask CNN's json file and the bdd 100k json file.

Please sign in to comment.