Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<BUG>关于数据集加载 #646

Open
CuddleSabe opened this issue Oct 26, 2023 · 0 comments
Open

<BUG>关于数据集加载 #646

CuddleSabe opened this issue Oct 26, 2023 · 0 comments

Comments

@CuddleSabe
Copy link

retry = 3 while retry > 0: try: img_bytes = self.file_client.get(gt_path, 'gt') except (IOError, OSError) as e: logger = get_root_logger() logger.warn(f'File client error: {e}, remaining retry times: {retry - 1}') # change another file to read index = random.randint(0, self.__len__()) gt_path = self.paths[index] time.sleep(1) # sleep 1s for occasional server congestion else: break finally: retry -= 1 img_gt = imfrombytes(img_bytes, float32=True)

其中random.randint(0, self.len())生成的随机数右侧是闭合的,因此会超出索引范围,修改为random.randint(0, self.len()-1)即可。numpy的randint右侧是不包的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant