Skip to content

Training the semi supervised model with SWIN tiny backbone #11

@bratjay01

Description

@bratjay01

Hello everyone! Good work!
I'm trying to develop a semi supervised semantic segmentation pipeline using a custom dataset. I was able to train the teacher model using labelled data only (pretraining) with the SWIN tiny backbone and saved those weights (TEACHER_CKPT). I have downloaded and converted the SWIN pretrained weights as mentioned in Mask2Former repo for this(swin-to-d2). However, when i train the semi supervised model i encounter this error "Invalid magic number". But i do not encounter this error with the RESNET backbones which also uses pretrained weights as .pkl.
Can someone help me out with this issue? How do i solve this?

` Traceback (most recent call last):
783   File "train_net.py", line 435, in <module>
784     launch(
785   File "/share/bharath/detectron2/detectron2/engine/launch.py", line 84, in launch
786     main_func(*args)
787   File "train_net.py", line 428, in main
788     trainer.resume_or_load(resume=args.resume)
789   File "/share/bharath/Mask2Former_SSL/modules/defaults.py", line 483, in resume_or_load
790     self.modified_checkpointer(resume)
791   File "/share/bharath/Mask2Former_SSL/modules/defaults.py", line 451, in modified_checkpointer
792     which = self.parse_ckpt(self.cfg.MODEL.WEIGHTS)
793   File "/share/bharath/Mask2Former_SSL/modules/defaults.py", line 427, in parse_ckpt
794     ckpt = torch.load(ckpt_dir, map_location='cpu')['model']
795   File "/share/bharath/miniconda3/envs/mask2former/lib/python3.8/site-packages/torch/serialization.py", line 608, in load
796     return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
797   File "/share/bharath/miniconda3/envs/mask2former/lib/python3.8/site-packages/torch/serialization.py", line 779, in _legacy_load
798     raise RuntimeError("Invalid magic number; corrupt file?")
799 RuntimeError: Invalid magic number; corrupt file?`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions