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: operands could not be broadcast together with shapes (900,1600,1) (900,1600) #21

Open
largerwxt opened this issue Feb 1, 2023 · 0 comments

Comments

@largerwxt
Copy link

Hello, the following error occurred when I reproduced the code. How can I solve it?
Traceback (most recent call last):
File "core/train.py", line 156, in
main()
File "core/train.py", line 150, in main
train(args, model, optimizer, train_loader, epoch)
File "core/train.py", line 78, in train
for iteration, batch in enumerate(train_loader, 1):
File "/home/anaconda/envs/wxt-env/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 628, in next
data = self._next_data()
File "/home/anaconda/envs/wxt-env/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 671, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/anaconda/envs/wxt-env/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/anaconda/envs/wxt-env/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/wxt/AIM-master/core/data.py", line 101, in getitem
ori, fg, bg = generate_composite(fg, bg, mask)
File "/home/wxt/AIM-master/core/util.py", line 111, in generate_composite
composite = alpha * fg + (1 - alpha) * bg
ValueError: operands could not be broadcast together with shapes (900,1600,1) (900,1600)

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