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

Running regression demo.py in container with Ubuntu 18.04 #38

Open
Bobowoo2468 opened this issue Jan 27, 2024 · 1 comment
Open

Running regression demo.py in container with Ubuntu 18.04 #38

Bobowoo2468 opened this issue Jan 27, 2024 · 1 comment

Comments

@Bobowoo2468
Copy link

Hi Shapy devs,

Could you assist with helping me debug this error? I have strung up a container with Ubuntu 18.04 with CUDA enabled.
Thank you so much in advance!

Here is the command that was executed:
MESA_GL_VERSION_OVERRIDE=4.1 python3 demo.py --save-vis true --save-params true --save-mesh true --split test --datasets openpose --output-folder ../samples/shapy_fit/ --exp-cfg configs/b2a_expose_hrnet_demo.yaml --exp-opts output_folder=../data/trained_models/shapy/SHAPY_A part_key=pose datasets.pose.openpose.data_folder=../samples datasets.pose.openpose.img_folder=images datasets.pose.openpose.keyp_folder=openpose datasets.batch_size=1 datasets.pose_shape_ratio=1.0

The error given in traceback is as follows:

File "/home/shapy/regressor/human_shape/utils/transf_utils.py", line 73, in crop
new_x = max(0, -ul[0]), min(br[0], len(img[0])) - ul[0]
IndexError: index 0 is out of bounds for axis 0 with size 0

Full error traceback shown below:

Traceback (most recent call last):
File "demo.py", line 435, in
main(cfg, show=show, demo_output_folder=output_folder, pause=pause,
File "/usr/local/lib/python3.8/dist-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
return func(*args, **kwargs)
File "demo.py", line 212, in main
for bidx, batch in enumerate(tqdm(body_dloader, dynamic_ncols=True)):
File "/usr/local/lib/python3.8/dist-packages/tqdm/std.py", line 1167, in iter
for obj in iterable:
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 435, in next
data = self._next_data()
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/usr/local/lib/python3.8/dist-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/shapy/regressor/human_shape/data/datasets/openpose.py", line 240, in getitem
img, cropped_image, target = self.transforms(
File "/home/shapy/regressor/human_shape/data/transforms/transforms.py", line 32, in call
output = t(*next_input, **kwargs)
File "/home/shapy/regressor/human_shape/data/transforms/transforms.py", line 542, in call
cropped_image = crop(
File "/home/shapy/regressor/human_shape/utils/transf_utils.py", line 73, in crop
new_x = max(0, -ul[0]), min(br[0], len(img[0])) - ul[0]
IndexError: index 0 is out of bounds for axis 0 with size 0

@muelea
Copy link
Owner

muelea commented Feb 17, 2024

The demo command looks fine, but the demo either doesn't find the image or the bounding box / OpenPose file. Maybe check if you can access them. Check the img, ul, and br variables to see which one is not working.

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

2 participants