YOLOX 0.3.0
Git版本:6d30efe8f9f277e8788fb2d9b17d08238a5ea292
Date: Thu Feb 16 13:18:49 2023 +0800
自定义训练时报错:
TypeError: decorator() takes 1 positional argument but 2 were given
问题出在YOLOX/yolox/data/datasets/datasets_wrapper.py
的最后一段代码
def cache_read_img(use_cache=True):
def decorator(read_img_fn):
"""
Decorate the read_img function to cache the image
Args:
read_img_fn: read_img function
use_cache (bool, optional): For the decorated read_img function,
whether to read the image from cache.
Defaults to True.
"""
@wraps(read_img_fn)
def wrapper(self, index, use_cache=use_cache):
cache = self.cache and use_cache
if cache:
if self.cache_type == "ram":
img = self.imgs[i