I would like to use YOLOv7 for segmentation on my custom dataset and custom classes.
I am already able to run the 'normal' YOLO version with my data and using the yolov7.pt
weights.
But when I am using the yolov7-mask.pt
weights, I end up having an error:
Traceback (most recent call last):
File "train.py", line 616, in <module>
train(hyp, opt, device, tb_writer)
File "train.py", line 71, in train
run_id = torch.load(weights, map_location=device).get('wandb_id') if weights.endswith('.pt') and os.path.isfile(weights) else None
File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 789, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 1131, in _load
result = unpickler.load()
File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 1124, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'Merge' on <module 'models.common' from '/content/yolov7/models/common.py'>
I also saw that this error is not specific to me, but not a solution.
Also, this tutorial does not use pre-trained weights and does not mention why it does so.
When I do not use pretrained weights the code compiles, but I did not check yet how good it is (I assume will take much longer to train).
Any advice will be appreciated.