mmgeneration
mmgeneration copied to clipboard
TypeError: UnconditionalImageDataset: __init__() got an unexpected keyword argument 'dataset'
Checklist
- I have searched related issues but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- The bug has not been fixed in the latest version.
Describe the bug
Traceback (most recent call last): File "/home/lthpc/anaconda2/envs/ljq/lib/python3.8/site-packages/mmcv/utils/registry.py", line 69, in build_from_cfg return obj_cls(**args) TypeError: init() got an unexpected keyword argument 'dataset'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/train.py", line 228, in
Reproduction
-
What command or script did you run? bash tools/dist_train.sh configs/styleganv3/stylegan3_r_ada_fp16_gamma3.3_flag_TW_640_b4x8.py 1 --work-dir ./work_dirs/experiments/TW
-
Did you make any modifications on the code or config? Did you understand what you have modified? yes,I have changed the cfg file
-
What dataset did you use? my dataset
Environment
_sys.platform: linux Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0] CUDA available: True CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 10.0, V10.0.130 GPU 0: TITAN V GPU 1,2: GeForce RTX 2080 SUPER GPU 3: TITAN Xp GCC: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 PyTorch: 1.12.0+cu102 PyTorch compiling details: PyTorch built with:
- GCC 7.3
- C++ Version: 201402
- Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v2.6.0 (Git Hash 52b5f107dd9cf10910aaa19cb47f3abf9b349815)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: AVX2
- CUDA Runtime 10.2
- 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_70,code=sm_70
- CuDNN 7.6.5
- Magma 2.5.2_**
Error traceback If applicable, paste the error trackback here.
I don't know what's the meaning of the "dataset" error,and why ,I just change the cfg file, if anyone can help me, I will be appreciated.
Seems that you use a self-defined config is modified from stylegan3_r_ada_fp16_gamma3.3_metfaces_1024_b4x8
.
In the original config, dataset
is defined in https://github.com/open-mmlab/mmgeneration/blob/master/configs/_base_/datasets/ffhq_flip.py
Maybe you remove RepeatDataset
from data['train']
but still remain dataset
. If you do not want to use RepeatDataset
, you can use the following config:
data = dict(
samples_per_gpu=None,
workers_per_gpu=4,
train=dict(type=dataset_type, imgs_root=None, pipeline=train_pipeline)),
val=dict(type=dataset_type, imgs_root=None, pipeline=val_pipeline))