TypeError: __init__() got an unexpected keyword argument 'times' #11936
Unanswered
ArpanGyawali
asked this question in
General
Replies: 2 comments 1 reply
|
I have similar problem, have you been able to resolve this ? |
0 replies
|
Oh hello friend! You have a very simple mistake! And in this dataset there is a call to an additional dataset: train_dataloader = dict(
batch_size=2,
num_workers=2,
persistent_workers=True,
sampler=dict(type='DefaultSampler', shuffle=True),
batch_sampler=dict(type='AspectRatioBatchSampler'),
dataset=dict(
type='RepeatDataset',
times=3,
dataset=dict(
type=dataset_type,
data_root=data_root,
ann_file='annotations/instances_train2017.json',
data_prefix=dict(img='train2017/'),
filter_cfg=dict(filter_empty_gt=True, min_size=32),
pipeline=train_pipeline,
backend_args=backend_args)))After, in YOURS, created by you. Config. train_dataloader = dict(
batch_size=train_batch_size_per_gpu,
num_workers=train_num_workers,
persistent_workers=True,
dataset=dict(
type=dataset_type,
data_root=data_root,
metainfo=metainfo,
pipeline=train_pipeline,
data_prefix=dict(img='train/'),
filter_empty_gt=False,
ann_file=data_root + '/' + train_ann_file,
backend_args=None))But the trick is that you DO NOT DELETE the old dataset, you just "update" it! For a clearer implementation, in your version, you need to recreate the dataset completely, and delete the old one. train_dataloader = dict(
_delete_=True,
batch_size=train_batch_size_per_gpu,
num_workers=train_num_workers,
persistent_workers=True,
dataset=dict(
type=dataset_type,
data_root=data_root,
metainfo=metainfo,
pipeline=train_pipeline,
data_prefix=dict(img='train/'),
filter_empty_gt=False,
ann_file=data_root + '/' + train_ann_file,
backend_args=None)) |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am working on LVO detection (A single class detection where dataset have both positive(with 1 to 2 boxes) and negative(without any boxes) sample images. I am using faster rcnn model.
My config is comething like this:
But while running train script or even browse_aug script, I am facing this error:
!python tools/train.py {config}
I have checked the previous similar issue but i havent used dataset type as RepeatedDataset and i have not used any times argument in dataloader. I couldnt solve the problem.
My env:
Please help me and if i need to provide more information that i will do that.
Thanks on advance
All reactions