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: Sample larger than population or is negative #70

Open
Larerr opened this issue Apr 9, 2024 · 0 comments
Open

ValueError: Sample larger than population or is negative #70

Larerr opened this issue Apr 9, 2024 · 0 comments

Comments

@Larerr
Copy link

Larerr commented Apr 9, 2024

Thanks to the author for his wonderful work!
I am executing the function Three-step 3D Feature Extraction (Scene) and after Step1 I get the following output:
image
But when I execute the
python chatcaption.py --specific_scene f6e9ec5953854dff94176c36b877c519
I get the following error:

Traceback (most recent call last):
  File "chatcaption.py", line 108, in <module>
    main()
  File "chatcaption.py", line 85, in main
    caption_result = caption_images_from_dir(
  File "/data3/hongbo.wang/3D-LLM/3DLanguage_data/ChatCaptioner_based/caption.py", line 455, in caption_images_from_dir
    image_list = random.sample(image_list, 4)
  File "/home/hongbo.wang/anaconda3/envs/3DLLM/lib/python3.8/random.py", line 363, in sample
    raise ValueError("Sample larger than population or is negative")
ValueError: Sample larger than population or is negative

After debugging, it was found to be in . /3DLanguage_data/ChatCaptioner_based/caption.py, and found that there was a problem with the function caption_images_from_dir.

    for view in views.
        image_list = glob.glob(f"{image_dir}/rgb_{view}*.png")
        image_list = [os.path.basename(path) for path in image_list]
        image_list = sorted(image_list, key=lambda i: int(re.findall(r"\d+", i)[0]))
        image_list = random.sample(image_list, 4)

This code is looking for a file with the name "rgb_outside*"** from the output file of Step1, but . /3DLanguage_data/ChatCaptioner_based/objaverse_render/render.py doesn't have a file with "rgb" in its name, which causes the random.sample(image_list, 4), the image_list is empty, so I get an error.

Please ask the author what should be done to solve this situation, thanks a million!

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