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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy activations from one parts to another part in tensor, but report error #35944

Open
bo-miao opened this issue Apr 3, 2020 · 1 comment
Open
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@bo-miao
Copy link

bo-miao commented Apr 3, 2020

馃悰 Bug

I want to copy the activations from one region in image (tensor, shape=(3, 800, 800)) to another region with same shape, and after dealing with parts of dataset, a bug will be reported.

ValueError: could not broadcast input array from shape (3,97,39) into shape (3,97,40)

Parts of my code is :
tmp = image[:, old_y0:old_y1+1, old_x0:old_x1+1]
image[:, old_y0+offset_y:old_y1+offset_y+1, old_x0+offset_x:old_x1+offset_x+1] = tmp

What I confused is that the location interval is exactly the same between two parts, but a bug was reported.

Version:
Pytorch 1.4

@jerryzh168
Copy link
Contributor

jerryzh168 commented Apr 6, 2020

I think it might be because old_x1+1 is out of range? could you check?

@jerryzh168 jerryzh168 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants