Skip to content

An error about loading config #207

@shenglunch

Description

@shenglunch

Hello,

When I run Config.fromfile('mono/configs/HourglassDecoder/vit.raft5.large.py'), there is an error TypeError: cannot pickle 'module' object.

When I run Config.fromfile('mono/configs/HourglassDecoder/convlarge.0.3_150.py'), it performs correctly.

Please, how to solve it?

Here is my code,

try:
from mmcv.utils import Config, DictAction
except:
from mmengine import Config, DictAction
from .model.monodepth_model import get_configured_monodepth_model
from .utils.running import load_ckpt

def get_model(config, pretrained):
net_cfg = Config.fromfile(config)
net = get_configured_monodepth_model(net_cfg, )
net, _, _, _ = load_ckpt(pretrained, net, strict_match=False)
return net

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions