chensnathan / YOLOF

You Only Look One-level Feature (YOLOF), CVPR2021, Detectron2
MIT License
271 stars 28 forks source link

detectron2环境的X-101-64x4d预训练权重用不了 #41

Open gfzwytc opened 1 year ago

gfzwytc commented 1 year ago

训练时使用X-101-64x4d作为主干网络,下载的预训练权重无法使用,权重文件的下载地址在detectron文件夹中。 但是其他主干网络的预训练权重的下载地址都在detectron2文件夹中,是因为X-101-64x4d的预训练权重和detectron2的环境不匹配吗,请问作者在训练时有遇到过这样的问题吗?

image image

[12/17 21:15:06 d2.data.build]: Using training sampler TrainingSampler [12/17 21:15:06 d2.data.common]: Serializing 5199 elements to byte tensors and concatenating them all ... [12/17 21:15:06 d2.data.common]: Serialized dataset takes 16.94 MiB [12/17 21:15:06 fvcore.common.checkpoint]: [Checkpointer] Loading from catalog://ImageNetPretrained/FAIR/X-101-64x4d ... [12/17 21:15:06 d2.checkpoint.catalog]: Catalog entry catalog://ImageNetPretrained/FAIR/X-101-64x4d points to https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/FBResNeXt/X-101-64x4d.pkl Traceback (most recent call last): File "train_Rtinanet.py", line 175, in args=(args,), File "D:\paddle\detectron2\detectron2\engine\launch.py", line 82, in launch main_func(args) File "train_Rtinanet.py", line 158, in main trainer.resume_or_load(resume=args.resume) File "D:\paddle\detectron2\detectron2\engine\defaults.py", line 412, in resume_or_load self.checkpointer.resume_or_load(self.cfg.MODEL.WEIGHTS, resume=resume) File "D:\Anaconda\envs\detectron2\lib\site-packages\fvcore\common\checkpoint.py", line 229, in resume_or_load return self.load(path, checkpointables=[]) File "D:\paddle\detectron2\detectron2\checkpoint\detection_checkpoint.py", line 52, in load ret = super().load(path, args, **kwargs) File "D:\Anaconda\envs\detectron2\lib\site-packages\fvcore\common\checkpoint.py", line 156, in load incompatible = self._load_model(checkpoint) File "D:\paddle\detectron2\detectron2\checkpoint\detection_checkpoint.py", line 95, in _load_model self._convert_ndarray_to_tensor(checkpoint["model"]) File "D:\Anaconda\envs\detectron2\lib\site-packages\fvcore\common\checkpoint.py", line 372, in _convert_ndarray_to_tensor "Unsupported type found in checkpoint! {}: {}".format(k, type(v)) ValueError: Unsupported type found in checkpoint! weight_order: <class 'str'>