Open laxmimerit opened 2 years ago
UPDATE For time being I had to modify saved model with this code. It is just workaround. It worked!
model = torch.load('models/local/latest.pth')
model['meta']['PALETTE'] = color_palette
torch.save(model, 'models/local/latest_palette.pth')
we will fix it asap
Hi, I am getting following error while loading the model after retraining on my custom dataet.
mmseg/apis/inference.py:36, in init_segmentor(config, checkpoint, device) 34 checkpoint = load_checkpoint(model, checkpoint, map_location='cpu') 35 model.CLASSES = checkpoint['meta']['CLASSES'] ---> 36 model.PALETTE = checkpoint['meta']['PALETTE'] 37 model.cfg = config # save the config in the model for convenience 38 model.to(device) KeyError: 'PALETTE'
I checked the keys in my saved model which are these
dict_keys(['epoch', 'iter', 'mmcv_version', 'time', 'CLASSES'])
Did training with following code
# Build the detector model = build_segmentor(cfg.model) # Add an attribute for visualization convenience model.CLASSES = datasets[0].CLASSES model.PALETTE = datasets[0].PALETTE # Create work_dir mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir)) train_segmentor(model, datasets, cfg, distributed=False, validate=True, meta=dict())
same problem
we will fix it asap
When will it be solved?
See workaround here https://github.com/open-mmlab/mmsegmentation/issues/2039#issuecomment-1239197221
On Sun, 16 Apr 2023 at 8:35 AM, LeiZhenYu @.***> wrote:
we will fix it asap
When will it be solved?
— Reply to this email directly, view it on GitHub https://github.com/open-mmlab/mmsegmentation/issues/2039#issuecomment-1510029152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7QW5CMV4VU2T7IJ67WDCTXBNOXFANCNFSM6AAAAAAQGTOBQU . You are receiving this because you authored the thread.Message ID: @.***>
Hi, I am getting following error while loading the model after retraining on my custom dataet.
I checked the keys in my saved model which are these
Did training with following code