Open dee6600 opened 4 years ago
I have the same issue. How have you solved it?
Hi same issue here
@smithee77 I've got it aß I changed to tensor.cpu(). detach().numpy() But I have no output prediction aß Image. Only in cmd or conda as text
@Whisper94 hi! same here! I tried your solution and works fine :) except no output image :(
@Whisper94 hi! same here! I tried your solution and works fine :) except no output image :(
me too no output image
python video.py --cam Loading network..... C:\Users\dee\Anaconda3\envs\torch\lib\site-packages\torch\nn_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead. warnings.warn(warning.format(ret)) Network successfully loaded OpenCV: FFMPEG: tag 0x47504a4d/'MJPG' is not supported with codec id 7 and format 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v' video.py:127: UserWarning: volatile was removed and now has no effect. Use
output = non_max_suppression(output, confidence, num_classes, nms_conf = nms_thesh)
File "C:\Users\dee\Documents\Object-Counter-YOLOV3\util\utils.py", line 127, in non_max_suppression
img_classes = unique(imagepred[:,-1]) # -1 index holds the class index
File "C:\Users\dee\Documents\Object-Counter-YOLOV3\util\utils.py", line 63, in unique
tensor_np = tensor.detach().numpy()
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback
with torch.no_grad():
instead. output = model(Variable(img, volatile = True)) Traceback (most recent call last): File "video.py", line 128, inTrying on cam