yolov5-7.0训练实力分割报错

2023-12-21 11:32:36

File “train.py”, line 666, in
main(opt)
File “train.py”, line 557, in main
train(opt.hyp, opt, device, callbacks)
File “train.py”, line 349, in train
logger.log_images(files, ‘Mosaics’, epoch)
File “/root/autodl-tmp/yolov5-master/utils/loggers/init.py”, line 360, in log_images
self.tb.add_image(f.stem, cv2.imread(str(f))[…, ::-1], epoch, dataformats=‘HWC’)
File “/root/miniconda3/lib/python3.8/site-packages/torch/utils/tensorboard/writer.py”, line 549, in add_image
image(tag, img_tensor, dataformats=dataformats), global_step, walltime)
File “/root/miniconda3/lib/python3.8/site-packages/torch/utils/tensorboard/summary.py”, line 396, in image
image = make_image(tensor, rescale=rescale)
File “/root/miniconda3/lib/python3.8/site-packages/torch/utils/tensorboard/summary.py”, line 438, in make_image
image = image.resize((scaled_width, scaled_height), Image.ANTIALIAS)
AttributeError: module ‘PIL.Image’ has no attribute ‘ANTIALIAS’

原因是pillow版本有问题,默认是10.1.0
解决办法:pip install pillow==9.5.0

文章来源:https://blog.csdn.net/qq_37797583/article/details/135123162
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。