centerface训练WiderFace数据集错误总结

调试Centerface程序时,报错如下

错误1

(torch110) root@fb488cec2ed5:/home/work/gaotong/xinying/ZCenterFace/src# python main.py
Traceback (most recent call last):
File “main.py”, line 14, in
from models.model import create_model, load_model, save_model
File “/home/work/gaotong/xinying/ZCenterFace/src/lib/models/model.py”, line 5, in
import torchvision.models as models
File “/root/anaconda3/lib/python3.7/site-packages/torchvision/init.py”, line 2, in
from torchvision import datasets
File “/root/anaconda3/lib/python3.7/site-packages/torchvision/datasets/init.py”, line 9, in
from .fakedata import FakeData
File “/root/anaconda3/lib/python3.7/site-packages/torchvision/datasets/fakedata.py”, line 3, in
from … import transforms
File “/root/anaconda3/lib/python3.7/site-packages/torchvision/transforms/init.py”, line 1, in
from .transforms import *
File “/root/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py”, line 17, in
from . import functional as F
File “/root/anaconda3/lib/python3.7/site-packages/torchvision/transforms/functional.py”, line 5, in
from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION

ImportError: cannot import name ‘PILLOW_VERSION’ from ‘PIL’ (/root/anaconda3/lib/python3.7/site-packages/PIL/init.py)

解决方法:根据报错的最后一行提示,打开function.py文件,

使用from PIL import Image, ImageOps, ImageEnhance, version 替换文件中from PIL import Image, ImageOps, ImageEnhance,PILLOW_VERSION这句。

说白了就是用__version__ 替换原来的PILLOW_VERSION。点击保存即可。
参考博客:https://blog.csdn.net/Lee_lg/article/details/103901632

错误二

(torch110) root@fb488cec2ed5:/home/work/gaotong/xinying/ZCenterFace/src# python test_wider_face.py
Traceback (most recent call last):
File “test_wider_face.py”, line 13, in
from datasets.dataset_factory import get_dataset
File “/home/work/gaotong/xinying/ZCenterFace/src/lib/datasets/dataset_factory.py”, line 8, in
from .sample.multi_pose import MultiPoseDataset
File “/home/work/gaotong/xinying/ZCenterFace/src/lib/datasets/sample/multi_pose.py”, line 20, in
from torch._six import container_abcs, string_classes, int_classes
ImportError: cannot import name 'container_abcs’

解决方法:torch的版本不对,下载0.4.1出现这个问题,有下载了1.1版就不存在这个问题了

错误3

运行测试程序时,nms编译不成功

解决方法:把0.4.1的pytorch升级成1.0.0,都没再编译,就运行成功了

错误4

RuntimeError: CUDA out of memory. Tried to allocate 175.88 MiB (GPU 0; 11.17 GiB total capacity; 2.6

解决方法: batchsize设为8,设置为多卡训练,chunk size改成2

错误5:

:cannot connect to X server

解决方法:把/sec/lib/detectors/Molti_pose.py脚本中的99行

debugger.show_all_imgs(pause=self.pause)
改成debugger.save_all_imgs(path=’/home/work/gaotong/xinying/ZCenterFace/output’,genID=True),

path设为自己的路径

你可能感兴趣的:(centerface训练WiderFace数据集错误总结)