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

The parameter RESCALE type mismatch when read config from yaml file #68

Open
TenshGU opened this issue Apr 9, 2024 · 7 comments
Open

Comments

@TenshGU
Copy link

TenshGU commented Apr 9, 2024

Hi, I am so sorry to bother you again.
When I use the following command to run the code:

python train_eval.py --cfg experiments/vgg16_pca_willow.yaml

A type mismatch error raising:

Error under config key: PROBLEM
Traceback (most recent call last):
  File "train_eval.py", line 288, in <module>
    args = parse_args('Deep learning of graph matching training & evaluation code.')
  File "/workspace/gm/src/utils/parse_args.py", line 19, in parse_args
    cfg_from_file(f)
  File "/workspace/gm/src/utils/config.py", line 272, in cfg_from_file
    _merge_a_into_b(yaml_cfg, __C)
  File "/workspace/gm/src/utils/config.py", line 245, in _merge_a_into_b
    _merge_a_into_b(a[k], b[k])
  File "/workspace/gm/src/utils/config.py", line 240, in _merge_a_into_b
    raise ValueError('Type mismatch ({} vs. {}) for config key: {}'.format(type(b[k]), type(v), k))
ValueError: Type mismatch (<class 'tuple'> vs. <class 'list'>) for config key: RESCALE

The image I used is:

runzhongwang/thinkmatch:torch1.6.0-cuda10.1-cudnn7-pyg1.6.3-pygmtools0.5.1

Here is my analysis of this error:


I don't know if it's because there's something wrong with my configuration or what?
Forgive my stupidity.

@rogerwwww
Copy link
Member

rogerwwww commented Apr 9, 2024

Hi there,

You may modify the type in src/utils/config.py manually. It seems to be an issue with yaml versions or something like that

@TenshGU
Copy link
Author

TenshGU commented Apr 11, 2024

Hi there,

You may modify the type in src/utils/config.py manually. It seems to be an issue with yaml versions or something like that

Thank you so much.
By the way, will there be a follow-up PR to solve this question?

@rogerwwww
Copy link
Member

I will have to double check what is the real reason of this issue before an official fix. Thanks for reporting!

@IdoSpringer
Copy link

Hi, I also got the same error

@Lin-Yijie
Copy link
Contributor

Add two lines in config.py could make it work. The issue seems to be related to changes in the YAML loading package.

   if 'RESCALE' in yaml_cfg['PROBLEM']:
        yaml_cfg['PROBLEM']['RESCALE'] = tuple(yaml_cfg['PROBLEM']['RESCALE'])

@IdoSpringer
Copy link

Great, thank you!

@rogerwwww
Copy link
Member

rogerwwww commented Jun 4, 2024

Add two lines in config.py could make it work. The issue seems to be related to changes in the YAML loading package.

   if 'RESCALE' in yaml_cfg['PROBLEM']:
        yaml_cfg['PROBLEM']['RESCALE'] = tuple(yaml_cfg['PROBLEM']['RESCALE'])

Thanks @Lin-Yijie ! Will update in the master branch

rogerwwww added a commit that referenced this issue Jun 4, 2024
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

4 participants