WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

suddenly with train.py error

kyip375 opened this issue · comments

Hi, please help, I am using your train.py to create model, and It was working fine. but suddenly not working. I am using google colab.
This is the stack trace. can you tell me how to fix it? thank you.

Epoch gpu_mem GIoU obj cls total targets img_size
0/99 12.8G 0.1002 0.0298 0.04798 0.1779 23 640: 100% 58/58 [01:06<00:00, 1.14s/it]
Class Images Targets P R mAP@.5 mAP@.5:.95: 0% 0/12 [00:00<?, ?it/s]/usr/local/lib/python3.7/dist-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Class Images Targets P R mAP@.5 mAP@.5:.95: 0% 0/12 [00:01<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 443, in
train(hyp, opt, device, tb_writer)
File "train.py", line 313, in train
save_dir=log_dir)
File "/content/ScaledYOLOv4/test.py", line 189, in test
plot_images(img, output_to_target(output, width, height), paths, str(f), names) # predictions
File "/content/ScaledYOLOv4/utils/general.py", line 1103, in output_to_target
return np.array(targets)
File "/usr/local/lib/python3.7/dist-packages/torch/_tensor.py", line 678, in array
return self.numpy()
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.