Closed kdavidlp123 closed 1 year ago
The file_client_args
parameter is no longer in use and has been deprecated. If you're loading data directly from a disk, it's safe to remove this argument from your configuration.
In addition, it's recommended that you include metainfo
in your dataset configuration. This can be done following the instructions provided in our user guide on preparing datasets, specifically in the section on using a custom dataset. Here is the link for your reference: https://mmpose.readthedocs.io/en/latest/user_guides/prepare_datasets.html#use-a-custom-dataset.
The 'area' refers to the number of pixels of the instance. The items 'segmentation' and 'area' are not necessary.
I followed the instruction and create a file under mmpose\datasets\datasets\body as below:
# Copyright (c) OpenMMLab. All rights reserved.
from mmpose.registry import DATASETS
from mmengine.dataset import BaseDataset
@DATASETS.register_module(name='customdataset')
class customdataset(BaseDataset):
METAINFO: dict = dict(from_file='configs/_base_/datasets/custom.py')
After that, I modified the init.py under mmpose\datasets\datasets\body as following:
from .aic_dataset import AicDataset
from .coco_dataset import CocoDataset
from .crowdpose_dataset import CrowdPoseDataset
from .jhmdb_dataset import JhmdbDataset
from .mhp_dataset import MhpDataset
from .mpii_dataset import MpiiDataset
from .mpii_trb_dataset import MpiiTrbDataset
from .ochuman_dataset import OCHumanDataset
from .posetrack18_dataset import PoseTrack18Dataset
from .posetrack18_video_dataset import PoseTrack18VideoDataset
from .custom_dataset import customdataset
__all__ = [
'CocoDataset', 'MpiiDataset', 'MpiiTrbDataset', 'AicDataset',
'CrowdPoseDataset', 'OCHumanDataset', 'MhpDataset', 'PoseTrack18Dataset',
'JhmdbDataset', 'PoseTrack18VideoDataset', 'customdataset'
]
I am not sure how to the step 3 and did I miss something that need to be modified for dataset registry?
It turned out that I used a wrong path of file for the data_root in the custom_mode python file. I corrected it and it started to train. Thank you for your kindness and patience !!!! You can close the issue now!! Thank you
Prerequisite
Environment
OrderedDict([('sys.platform', 'win32'), ('Python', '3.8.16 (default, Mar 2 2023, 03:18:16) [MSC v.1916 64 bit (AMD64)]'), ('CUDA available', True), ('numpy_random_seed', 2147483648), ('GPU 0', 'NVIDIA GeForce RTX 3090'), ('CUDA_HOME', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1'), ('NVCC', 'Cuda compilation tools, release 11.1, V11.1.105'), ('MSVC', 'Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30148 for x64'), ('GCC', 'n/a'), ('PyTorch', '1.9.1+cu111'), ('PyTorch compiling details', 'PyTorch built with:\n - C++ Version: 199711\n - MSVC 192829337\n - Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications\n - Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)\n - OpenMP 2019\n - CPU capability usage: AVX2\n - CUDA Runtime 11.1\n - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_37,code=compute_37\n - CuDNN 8.0.5\n - Magma 2.5.4\n - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, CXX_COMPILER=C:/w/b/windows/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/w/b/windows/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.9.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, \n'), ('TorchVision', '0.10.1+cu111'), ('OpenCV', '4.7.0'), ('MMEngine', '0.7.3'), ('MMPose', '1.0.0+2c4a60e')])
Reproduces the problem - code sample
For the \configs_base_\datasets\custom.py :
For the configs\body_2d_keypoint\topdown_heatmap\coco\custom_model.py:
Because I just want to run the script first, so I used training data as validation data.
Reproduces the problem - command or script
(openmmlab) PS D:\mmpose> python tools/train.py configs/body_2d_keypoint/topdown_heatmap/coco/custom_model.py Traceback (most recent call last): File "tools/train.py", line 160, in
main()
File "tools/train.py", line 142, in main
cfg = Config.fromfile(args.config)
File "C:\Users\user\anaconda3\envs\openmmlab\lib\site-packages\mmengine\config\config.py", line 178, in fromfile
cfg_dict, cfg_text, env_variables = Config._file2dict(
File "C:\Users\user\anaconda3\envs\openmmlab\lib\site-packages\mmengine\config\config.py", line 560, in _file2dict
cfg_dict = Config._substitute_base_vars(cfg_dict, base_var_dict,
File "C:\Users\user\anaconda3\envs\openmmlab\lib\site-packages\mmengine\config\config.py", line 423, in _substitute_base_vars
cfg[k] = Config._substitute_base_vars(
File "C:\Users\user\anaconda3\envs\openmmlab\lib\site-packages\mmengine\config\config.py", line 430, in _substitute_base_vars
cfg = [
File "C:\Users\user\anaconda3\envs\openmmlab\lib\site-packages\mmengine\config\config.py", line 431, in
Config._substitute_base_vars(c, base_var_dict, base_cfg)
File "C:\Users\user\anaconda3\envs\openmmlab\lib\site-packages\mmengine\config\config.py", line 420, in _substitute_base_vars
new_v = new_v[new_k]
File "C:\Users\user\anaconda3\envs\openmmlab\lib\site-packages\mmengine\config\config.py", line 48, in missing
raise KeyError(name)
KeyError: 'file_client_args'
Reproduces the problem - error message
No
Additional information
Do I need to modify other documents for training on custom datasets?
And do I also need to add or register new dataset under mmpose\datasets\datasets\body? It seems a little different from the old version.
Thank you!!!