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

ValueError: Cannot finished cropping adjustment within 25 tries (#instances 637). #630

Open
13181713593 opened this issue May 22, 2024 · 0 comments

Comments

@13181713593
Copy link

I made a mistake in training, the following is the error message.

File "/home/XX/detectron2-master/detectron2/data/transforms/augmentation.py", line 347, in apply_augmentations
    return AugmentationList(augmentations)(self)
  File "/home/XX/detectron2-master/detectron2/data/transforms/augmentation.py", line 264, in __call__
    tfm = x(aug_input)
  File "/home/XX/detectron2-master/detectron2/data/transforms/augmentation.py", line 165, in __call__
    tfm = self.get_transform(*args)
  File "/home/XX/DeepSolo_ori/adet/data/augmentation.py", line 110, in get_transform
    return gen_crop_transform_with_instance(
  File "/home/XX/DeepSolo_ori/adet/data/augmentation.py", line 53, in gen_crop_transform_with_instance
    raise ValueError(
ValueError: Cannot finished cropping adjustment within 25 tries (#instances 637).

(DEEPSOLO) XX@XX:~/XX/DeepSolo$ /home/XX/anaconda2/envs/DEEPSOLO/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 96 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

the source code in "adet/data/augmentation.py", line 53:

# if some instance is cropped extend the box
if not crop_box:
        num_modifications = 0
        modified = True

	#convert crop_size to float

    crop_size = crop_size.astype(np.float32)
    while modified:
        modified, x0, y0, crop_size = adjust_crop(x0, y0, crop_size, instances)
        num_modifications += 1
        if num_modifications > 25:
            raise ValueError(
                "Cannot finished cropping adjustment within 25 tries (#instances {}).".format(
                    len(instances)
                )
            )
            return T.CropTransform(0, 0, image_size[1], image_size[0])

return T.CropTransform(*map(int, (x0, y0, crop_size[1], crop_size[0])))

I don't know why such a requirement num_modifications > 25, and how to settle this problem

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