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: height and width must be > 0 #358

Open
worldofzeroandone opened this issue Oct 8, 2024 · 1 comment
Open

ValueError: height and width must be > 0 #358

worldofzeroandone opened this issue Oct 8, 2024 · 1 comment

Comments

@worldofzeroandone
Copy link

Traceback (most recent call last):
File "run.py", line 493, in
main()
File "run.py", line 438, in main
for _ in tqdm(
File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/site-packages/tqdm/std.py", line 1181, in iter
for obj in iterable:
File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/multiprocessing/pool.py", line 868, in next
raise value
ValueError: height and width must be > 0

I saw the solution is set the font dir,but I sepcify a font dir but it still has this problem,I want to generate 450000 images,I don't know if it's due to the size of images,but when I set the 45000 it still has the same problem

@worldofzeroandone
Copy link
Author

Traceback (most recent call last): File "run.py", line 493, in main() File "run.py", line 438, in main for _ in tqdm( File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/site-packages/tqdm/std.py", line 1181, in iter for obj in iterable: File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/multiprocessing/pool.py", line 868, in next raise value ValueError: height and width must be > 0

I saw the solution is set the font dir,but I sepcify a font dir but it still has this problem,I want to generate 450000 images,I don't know if it's due to the size of images,but when I set the 45000 it still has the same problem

this is my error:
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/gxu4090x2/桌面/chengang/TRDG/trdg/data_generator.py", line 22, in generate_from_tuple
cls.generate(*t)
File "/home/gxu4090x2/桌面/chengang/TRDG/trdg/data_generator.py", line 133, in generate
resized_img = distorted_img.resize(
File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/site-packages/PIL/Image.py", line 2305, in resize
im = im.resize(size, resample, box)
File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/site-packages/PIL/Image.py", line 2328, in resize
return self._new(self.im.resize(size, resample, box))
ValueError: height and width must be > 0
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "run.py", line 493, in
main()
File "run.py", line 438, in main
for _ in tqdm(
File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/site-packages/tqdm/std.py", line 1178, in iter
for obj in iterable:
File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/multiprocessing/pool.py", line 868, in next
raise value
ValueError: height and width must be > 0
value of mean pixel is too similar. Ignore this image
resized_img_st
[40.482142857142854, 40.482142857142854, 40.482142857142854, 185.16071428571428]
background_img_st
[11.379375, 37.9578125, 70.65375]
value of mean pixel is too similar. Ignore this image
resized_img_st
[39.689189189189186, 39.689189189189186, 39.689189189189186, 181.9189189189189]
background_img_st
[31.676875, 58.523125, 12.821875]

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