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 (1034,1034,3) (1000,) #1

Open
HripsimeS opened this issue Apr 6, 2023 · 0 comments

Comments

@HripsimeS
Copy link

HripsimeS commented Apr 6, 2023

@apresland Your approach looks interesting by using a GradCAM method for cancer detection on histopathologic images.
I tried to use it on my dataset and as a model I used the following
from keras.applications.resnet import ResNet50, preprocess_input
model = ResNet50(weights = 'imagenet')

For the last cell to plot the prediction show_gradCAMs(model, gradCAM, guidedBP, img_path) I get this errors

----> new_img = overlay_gradCAM(img, cam3, preds[0])
----> cam3 = np.uint8(255cam3prob)
ValueError: operands could not be broadcast together with shapes (1034,1034,3) (1000,)

Any ideas how how to fix this shapes issue to be able to plot the prediction? Thanks in advance!

@HripsimeS HripsimeS changed the title Dataset and lebels Dataset and labels Apr 6, 2023
@HripsimeS HripsimeS changed the title Dataset and labels ValueError: operands could not be broadcast together with shapes (1034,1034,3) (1000,) Apr 9, 2023
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