OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

When I was trying to train the ConvNeXt, I met an issue

  • Thread starter Thread starter WonderCreator
  • Start date Start date
W

WonderCreator

Guest
Code:
Traceback (most recent call last):
  File "tools/train.py", line 162, in <module>
    main()
  File "tools/train.py", line 158, in main
    runner.train()
  File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\runner.py", line 1728, in train
    self._train_loop = self.build_train_loop(
  File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\runner.py", line 1527, in build_train_loop
    loop = EpochBasedTrainLoop(
  File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\loops.py", line 44, in __init__
    super().__init__(runner, dataloader)
  File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\base_loop.py", line 26, in __init__
    self.dataloader = runner.build_dataloader(
  File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\runner.py", line 1370, in build_dataloader
    dataset = DATASETS.build(dataset_cfg)
  File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "d:\working\ai\convnext\convnext\mmpretrain\mmpretrain\datasets\custom.py", line 207, in __init__
    super().__init__(
TypeError: __init__() got an unexpected keyword argument 'split'

When I was trying to train ConvNeXt, above error occurred. I used this command.

python tools/train.py configs/convnext/convnext-tiny_32xb128_custom.py

convnext-tiny_32xb128_custom.py

Code:
_base_ = [
    '../_base_/models/convnext/convnext-tiny.py',
    '../_base_/datasets/imagenet_bs64_swin_224.py',
    '../_base_/schedules/imagenet_bs1024_adamw_swin.py',
    '../_base_/default_runtime.py',
]

# dataset setting
train_dataloader = dict(batch_size=128, dataset=dict(type="CustomDataset"))

# schedule setting
optim_wrapper = dict(
    optimizer=dict(lr=4e-3),
    clip_grad=None,
)

# runtime setting
custom_hooks = [dict(type='EMAHook', momentum=1e-4, priority='ABOVE_NORMAL')]

# NOTE: `auto_scale_lr` is for automatically scaling LR
# based on the actual training batch size.
# base_batch_size = (32 GPUs) x (128 samples per GPU)
auto_scale_lr = dict(base_batch_size=4096)

I used https://github.com/open-mmlab/mmpretrain.git
<pre><code>Traceback (most recent call last):
File "tools/train.py", line 162, in <module>
main()
File "tools/train.py", line 158, in main
runner.train()
File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\runner.py", line 1728, in train
self._train_loop = self.build_train_loop(
File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\runner.py", line 1527, in build_train_loop
loop = EpochBasedTrainLoop(
File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\loops.py", line 44, in __init__
super().__init__(runner, dataloader)
File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\base_loop.py", line 26, in __init__
self.dataloader = runner.build_dataloader(
File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\runner\runner.py", line 1370, in build_dataloader
dataset = DATASETS.build(dataset_cfg)
File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\registry\registry.py", line 570, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "C:\ProgramData\Anaconda3\envs\open-mmlab\lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg
obj = obj_cls(**args) # type: ignore
File "d:\working\ai\convnext\convnext\mmpretrain\mmpretrain\datasets\custom.py", line 207, in __init__
super().__init__(
TypeError: __init__() got an unexpected keyword argument 'split'
</code></pre>
<p>When I was trying to train ConvNeXt, above error occurred.
I used this command.</p>
<p>python tools/train.py configs/convnext/convnext-tiny_32xb128_custom.py</p>
<p>convnext-tiny_32xb128_custom.py</p>
<pre><code>_base_ = [
'../_base_/models/convnext/convnext-tiny.py',
'../_base_/datasets/imagenet_bs64_swin_224.py',
'../_base_/schedules/imagenet_bs1024_adamw_swin.py',
'../_base_/default_runtime.py',
]

# dataset setting
train_dataloader = dict(batch_size=128, dataset=dict(type="CustomDataset"))

# schedule setting
optim_wrapper = dict(
optimizer=dict(lr=4e-3),
clip_grad=None,
)

# runtime setting
custom_hooks = [dict(type='EMAHook', momentum=1e-4, priority='ABOVE_NORMAL')]

# NOTE: `auto_scale_lr` is for automatically scaling LR
# based on the actual training batch size.
# base_batch_size = (32 GPUs) x (128 samples per GPU)
auto_scale_lr = dict(base_batch_size=4096)
</code></pre>
<p>I used <a href="https://github.com/open-mmlab/mmpretrain.git" rel="nofollow noreferrer">https://github.com/open-mmlab/mmpretrain.git</a></p>
 

Latest posts

Top