Hi, when i run the following code, an error raises. Can anybody help? Thanks!
my code:
if len(args.test_model) != 0:
    assert os.path.exists(args.test_model), \
        "file not found: {}".format(args.test_model)

    checkpoint_ = torch.load(args.test_model)
    # FIXME
    key_m, key_u = net.load_state_dict(checkpoint_['model'], strict=False)

    if key_u:
        print('Unexpected keys :')
        print(key_u)

    if key_m:
        print('Missing keys :')
        print(key_m)
        raise KeyError

error:
Traceback (most recent call last):
File “/home4/user_from_home1/wangyufei/dc/dsd/test.py”, line 625, in 
main(config)
File “/home4/user_from_home1/wangyufei/dc/dsd/test.py”, line 621, in main
test(args)
File “/home4/user_from_home1/wangyufei/dc/dsd/test.py”, line 516, in test
checkpoint_ = torch.load(args.test_model)
File “/home1/wangyufei/anaconda3/envs/py3.8bindtr/lib/python3.8/site-packages/torch/serialization.py”, line 585, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File “/home1/wangyufei/anaconda3/envs/py3.8bindtr/lib/python3.8/site-packages/torch/serialization.py”, line 765, in _legacy_load
result = unpickler.load()
ModuleNotFoundError: No module named ‘metrics’