Skip to content

problem when training a deformable detr on cocodataset if the dataset is not downloaded on the machine #50

@LucBourrat1

Description

@LucBourrat1

if coco dataset does not exist in config file, user is asked to download and use a sample. If we answer yes there is a problem with the path.

Code to regenerate the bug (coco dataset need to not be on the machine):

from alonet.deformable_detr import LitDeformableDetr, DeformableDetrR50Finetune
from argparse import ArgumentParser, Namespace
import alonet
from alonet.detr import CocoDetection2Detr

import torch

def params2Namespace(litdetr, level):
print(f"[INFO] LEVEL {level}:", Namespace(
accumulate_grad_batches=litdetr.accumulate_grad_batches,
gradient_clip_val=litdetr.gradient_clip_val,
model_name=litdetr.model_name,
weights=litdetr.weights
))

TRAINING PIPELINE

device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu")

Parameters definition

Build parser (concatenates arguments to modify the entire project)

parser = ArgumentParser(conflict_handler="resolve")
parser = alonet.common.add_argparse_args(parser) # Add common arguments in train process
parser = CocoDetection2Detr.add_argparse_args(parser)
parser = LitDeformableDetr.add_argparse_args(parser)
args = parser.parse_args()

Dataset use to train

coco_loader = CocoDetection2Detr(args)
lit_deformable = LitDeformableDetr(args)

Train process

args.save = True # Uncomment this line to store trained weights
lit_deformable.run_train(
data_loader=coco_loader,
args=args,
project="deformable",
expe_name="coco_detr",
)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions