You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi !
in my file configuration (yolov4.cfg), i'm using this parameters :
width=512
height=512
channels=1
in cfg.py (YOLOv4_pytorch/tool/cfg.py), i'm using this parameters :
prev_width = 512
prev_height = 512
prev_filters = 1
```
i get all time this error :
File "./demo.py", line 43, in <module>
detect(cfgfile, weightfile, imgfile)
File "./demo.py", line 28, in detect
boxes = do_detect(m, sized, 0.5, 0.4, use_cuda)
File "/home/yassines/Downloads/YOLOv4_Pytorch/utils/utils.py", line 357, in do_detect
img = img.view(height, width, 3).transpose(0, 1).transpose(0, 2).contiguous()
RuntimeError: shape '[512, 512, 3]' is invalid for input of size 32768
i think, i need to change something in this code :
```
img = img.view(height, width, 3).transpose(0, 1).transpose(0, 2).contiguous()
# batch:1 channel:3
img = img.view(1, 3, height, width)
# 除以255,归一化
```
how i can change it to take just One channel not three channel ?
thank you
The text was updated successfully, but these errors were encountered:
i get all time this error :
File "./demo.py", line 43, in
detect(cfgfile, weightfile, imgfile)
File "./demo.py", line 28, in detect
boxes = do_detect(m, sized, 0.5, 0.4, use_cuda)
File "/home/yassines/Downloads/YOLOv4_Pytorch/utils/utils.py", line 357, in do_detect
img = img.view(height, width, 3).transpose(0, 1).transpose(0, 2).contiguous()
RuntimeError: shape '[512, 512, 3]' is invalid for input of size 32768
i think, i need to change something in this code :
how i can change it to take just One channel not three channel ?
thank you
Hello i am sorry just noticed...
Do you mean you want to use a grayscale image with channel 1 for testing? Since the code is not written by myself, and the pre-training model is based on color images, I guess the effect of testing grayscale images is not good.
Hi !
in my file configuration (yolov4.cfg), i'm using this parameters :
in cfg.py (YOLOv4_pytorch/tool/cfg.py), i'm using this parameters :
The text was updated successfully, but these errors were encountered: