-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Hello! I'm encountering the following error:
ValueError
This cell raised an exception: ValueError('operands could not be broadcast together with shapes (982,748,3) (748,982,3) ')
Here's my code:
<relevant imports here>
model = YOLO(<path to torch file>)
target_layers = [model.model.model[-2]]
cam = EigenCAM(model, target_layers, task="cls")
grayscale_cam = cam(
frame,
eigen_smooth=True,
)[0, :, :]
cam_image = show_cam_on_image(frame / 255, grayscale_cam, use_rgb=True)
plt.figure()
plt.imshow(cam_image)
plt.show()
My input, frame, has the correct dimensions of (784, 982, 3). When I view the CAM mask on it's own it has the right orientation but the dimensions are not correct. When I try transposing it, the dimensions match but then the orientation is not correct.
For now I'll just resize the CAM mask but I thought you might want to know the output dimensions are not correct.
Let me know if you want my input files or any other info to debug this. It's a project at work so I can't share all details but I can try to find public data that replicates my issue.
Thank you! Your repo is meeting my exact needs!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels