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

occur indexError #24

Open
CodeMadUser opened this issue May 30, 2022 · 2 comments
Open

occur indexError #24

CodeMadUser opened this issue May 30, 2022 · 2 comments

Comments

@CodeMadUser
Copy link

hello,when I use your code training, it occurs indexError:
in this part:
for i in range(4):
gt_i = ((gt[i] + 1.) * 127.5).astype(np.uint8)
masked_i = ((masked[i] + 1.) * 127.5).astype(np.uint8)
complete_i = ((complete[i] + 1.) * 127.5).astype(np.uint8)
recons_gt_i = ((recons_gt[i] + 1.) * 127.5).astype(np.uint8)

train_structure_generator.py:
Traceback (most recent call last):
File "train_structure_generator.py", line 366, in
nn.structure_visual(gt_np, masked_np, recons_gen_np, recons_gt_np, (i + 1), args.image_size, folder_path)
File "D:\pythonProject\5_19\VQ_VAE\net\nn.py", line 173, in structure_visual
gt_i = ((gt[i] + 1.) * 127.5).astype(np.uint8)
IndexError: index 1 is out of bounds for axis 0 with size 1

How many dimensions is the parameter gt? What data parameter is gt?thank you

@USTC-JialunPeng
Copy link
Owner

It is a naive visualization code that requires a batch size of at least 4 per GPU.

Please refer to #21 to visualize only 1 image if your batch size per GPU is less than 4.

@CodeMadUser
Copy link
Author

ok,I get it .thank you for your help.

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