Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jupyter tutorial cannot be run #6

Open
LutaoChu opened this issue Dec 21, 2021 · 0 comments
Open

jupyter tutorial cannot be run #6

LutaoChu opened this issue Dec 21, 2021 · 0 comments

Comments

@LutaoChu
Copy link

Error:


---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/tmp/ipykernel_19733/2885416576.py in <module>
      2 from iharm.inference.predictor import Predictor
      3 
----> 4 checkpoint_path = find_checkpoint(cfg.MODELS_PATH, 'hrnet_dih_001_adobe5k_last')
      5 # checkpoint_path = find_checkpoint(cfg.MODELS_PATH, 'hrnet18s_idih256')
      6 

~/image_harmonization/iharm/inference/utils.py in find_checkpoint(weights_folder, checkpoint_name)
     28     else:
     29         model_checkpoints = list(model_folder.rglob(f'{checkpoint_name}*.pth'))
---> 30         assert len(model_checkpoints) == 1
     31         checkpoint_path = model_checkpoints[0]
     32     return str(checkpoint_path)

Question 1: Where can I download the hrnet_ dih_ 001_ adobe5k_last model?
Question 2: if the model is replaced with hrnet18s_ idih256,The following errors will be reported during load_model. How should I modify them?

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/tmp/ipykernel_34762/4168270834.py in <module>
      5 checkpoint_path = find_checkpoint(cfg.MODELS_PATH, 'hrnet18s_idih256')
      6 
----> 7 net = load_model('hrnet_dih', checkpoint_path, verbose=True)
      8 # net = load_model('dih256', checkpoint_path, verbose=True)
      9 predictor = Predictor(net, device, with_flip=False)

~/image_harmonization/iharm/inference/utils.py in load_model(model_type, checkpoint_path, verbose)
      6 
      7 def load_model(model_type, checkpoint_path, verbose=False):
----> 8     net = ALL_MCONFIGS[model_type]['model'](**ALL_MCONFIGS[model_type]['params'])
      9     load_weights(net, checkpoint_path, verbose=verbose)
     10     return net

KeyError: 'hrnet_dih'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant