WongKinYiu / yolor

implementation of paper - You Only Learn One Representation: Unified Network for Multiple Tasks (https://arxiv.org/abs/2105.04206)
GNU General Public License v3.0
1.99k stars 517 forks source link

fixed function return type error 'output_to_target' #286

Open KotovNikitaStudent opened 1 year ago

KotovNikitaStudent commented 1 year ago

fixed an error when testing and training the model on a custom dataset. " Traceback (most recent call last): File "test.py", line 319, in test(opt.data, File "test.py", line 226, in test plot_images(img, output_to_target(output, width, height), paths, f, names) # predictions File "/yolor/utils/plots.py", line 109, in output_to_target return np.array(targets) File "/opt/conda/lib/python3.8/site-packages/torch/_tensor.py", line 721, 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. "

KotovNikitaStudent commented 1 year ago

fixed an error when testing and training the model on a custom dataset