Hi,i have a problem,i use VOC segmentation dataset to train a 21 classes net,but i meet the bellow problem。in predict.py
i change the ‘n_classes=21’。Look forward to your reply
Traceback (most recent call last):
File "predict.py", line 124, in
mask = predict_img(net=net,
File "predict.py", line 44, in predict_img
full_mask = tf(probs.cpu()).squeeze()
File "D:\software\anaconda3\envs\yolov5\lib\site-packages\torchvision\transforms\transforms.py", line 61, in call
img = t(img)
File "D:\software\anaconda3\envs\yolov5\lib\site-packages\torchvision\transforms\transforms.py", line 184, in call
return F.to_pil_image(pic, self.mode)
File "D:\software\anaconda3\envs\yolov5\lib\site-packages\torchvision\transforms\functional.py", line 243, in to_pil_image
raise ValueError('pic should not have > 4 channels. Got {} channels.'.format(pic.shape[-3]))
ValueError: pic should not have > 4 channels. Got 21 channels.
maybe i need to write script for multiple predict...
Hi, can you try the latest master? I pushed a fix