Comments (7)
We are also trying this as well.
We were able to solve the issue @praneet195 has by adding the following line after line 91 in misc_functions.py.
YOLOv3-GradCAM/gradcam/misc_functions.py
Line 91 in 6a66a9e
heatmap_on_image = heatmap_on_image.resize(heatmap.size)
This is at least a temporary fix.
from yolov3-gradcam.
I'll need to look into this further as something deeper is broken in the forward pass. For your specific error, you can replace:
int(mdef["from"])
with:
int(mdef["from"][0])
However, doing so will bring to light the other issues which I need to look into.
from yolov3-gradcam.
我需要进一步研究这一点,因为前向传递中有更深层的问题。对于您的特定错误,您可以替换:
int(mdef [ “ from” ])与:
int(mdef [ “ from” ] [ 0 ])但是,这样做会发现我需要研究的其他问题。
I'll need to look into this further as something deeper is broken in the forward pass. For your specific error, you can replace:
int(mdef["from"])with:
int(mdef["from"][0])However, doing so will bring to light the other issues which I need to look into.
YES,When I do what you say, I will still display the type error
x = x + layer_outputs[int(mdef["from"][0])] TypeError: unsupported operand type(s) for +: 'Tensor' and 'list'
Looking forward to your solution
from yolov3-gradcam.
Ok
So on going through the code, Line #95 in gradcam.py should just be layer_outputs.append(x)
This seems to work for me after taking into account the fix mentioned above.
Now i'm running into the following error in misc_functions.py on the line:
heatmap_on_image = Image.alpha_composite(heatmap_on_image, heatmap)
saying images donot match.
Trying to fix this but please let me know if you think the above fix is good enough?
from yolov3-gradcam.
image 1/1 data/samples/Jujube_4501.bmp: Model Summary: 222 layers, 6.1556e+07 parameters, 6.1556e+07 gradients Traceback (most recent call last): File "/home/zxzn/YOLOv3-GradCAM/gradcam/gradcam.py", line 178, in <module> cam = grad_cam.generate_cam(prep_img, target_class) File "/home/zxzn/YOLOv3-GradCAM/gradcam/gradcam.py", line 127, in generate_cam conv_output, model_output = self.extractor.forward_pass(input_image) File "/home/zxzn/YOLOv3-GradCAM/gradcam/gradcam.py", line 106, in forward_pass conv_output, x = self.forward_pass_on_convolutions(x) File "/home/zxzn/YOLOv3-GradCAM/gradcam/gradcam.py", line 91, in forward_pass_on_convolutions x = x + layer_outputs[int(mdef["from"])] TypeError: int() argument must be a string, a bytes-like object or a number, not 'list' Process finished with exit code 1
这是为什么?我使用了由yolov3 of Ultralytics训练的模型和相应的CFG,但无法正常工作。此外,我还从utils文件夹ultralytics models.py的yolov3文件中删除了该文件
这是我的目录结构
(cam) zxzn@zxzn:~/YOLOv3-GradCAM/gradcam$ ls cfg data detect.py gradcam.py misc_functions.py models.py __pycache__ test.py train.py utils weights
谢谢您的帮助@pifalken
你好,我也遇到了这个问题,请问您解决了吗?
from yolov3-gradcam.
好的,
所以在遍历代码时,gradcam.py中的第95行应该只是layer_outputs.append(x)。
考虑到上述修复后,这似乎对我有用。
现在,我在网上的misc_functions.py中遇到以下错误:
heatmap_on_image = Image.alpha_composite(heatmap_on_image, heatmap)
说图像不匹配。
尝试解决此问题,但是如果您认为上述修复足够好,请告诉我。
excause me,How do you fix this bug?
x = x + layer_outputs[int(mdef["from"])]
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
please help me。looking forward to your reply。
from yolov3-gradcam.
请问这个问题解决了吗????
from yolov3-gradcam.
Related Issues (10)
- have you finish this job? HOT 1
- Can you tell me your yolov3 project address? I would like to combine it to see if it is convenient
- weight 'w' did not multiply with feature map HOT 1
- Which version yolov3? HOT 1
- What do I have to do to move it? HOT 3
- Potential issue in creation of the target tensor for backpropagation
- Output size of extractor.forward_pass() HOT 1
- I'll need to look into this further as something deeper is broken in the forward pass. For your specific error, you can replace:
- Where can I find programs such as models.py and utils folder? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov3-gradcam.