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

open-mmlab weights are not loading #10

Closed
haritha91 opened this issue Oct 14, 2021 · 3 comments
Closed

open-mmlab weights are not loading #10

haritha91 opened this issue Oct 14, 2021 · 3 comments

Comments

@haritha91
Copy link

Tried to run model on THUMOS14 and seems open-mmlab://i3d_r50_256p_32x2x1_100e_kinetics400_rgb having an issue with loading. Attached the error log for reference.

@haritha91
Copy link
Author

2021-10-14 20:34:00,980 - vedatad - WARNING - EvalHook is not in modes ['train']
Traceback (most recent call last):
File "tools/trainval.py", line 65, in
2021-10-14 20:34:00,980 - vedatad - INFO - Loading weights from open-mmlab://i3d_r50_256p_32x2x1_100e_kinetics400_rgb
main()
File "tools/trainval.py", line 61, in main
trainval(cfg, distributed, logger)
File "/app/vedatad/vedatad/assembler/trainval.py", line 72, in trainval
looper.load_weights(**cfg.weights)
File "/app/vedatad/vedacore/loopers/base_looper.py", line 118, in load_weights
Traceback (most recent call last):
File "tools/trainval.py", line 65, in
load_weights(model, filepath, map_location, strict, self.logger,
File "/app/vedatad/vedacore/misc/checkpoint.py", line 278, in load_weights
main()
File "tools/trainval.py", line 61, in main
trainval(cfg, distributed, logger)
File "/app/vedatad/vedatad/assembler/trainval.py", line 72, in trainval
state_dict = _load_checkpoint(filepath, map_location)
File "/app/vedatad/vedacore/misc/checkpoint.py", line 143, in _load_checkpoint
looper.load_weights(**cfg.weights)
File "/app/vedatad/vedacore/loopers/base_looper.py", line 118, in load_weights
model_urls = get_open_mmlab_models()
File "/app/vedatad/vedacore/misc/checkpoint.py", line 34, in get_open_mmlab_models
load_weights(model, filepath, map_location, strict, self.logger,
model_urls = yaml.load(open(file_path))
File "/app/vedatad/vedacore/misc/checkpoint.py", line 278, in load_weights
TypeError: load() missing 1 required positional argument: 'Loader'
state_dict = _load_checkpoint(filepath, map_location)
File "/app/vedatad/vedacore/misc/checkpoint.py", line 143, in _load_checkpoint
model_urls = get_open_mmlab_models()
File "/app/vedatad/vedacore/misc/checkpoint.py", line 34, in get_open_mmlab_models
model_urls = yaml.load(open(file_path))
TypeError: load() missing 1 required positional argument: 'Loader'
Killing subprocess 391
Killing subprocess 392
Traceback (most recent call last):
File "/home/user/miniconda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/user/miniconda/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/user/miniconda/lib/python3.8/site-packages/torch/distributed/launch.py", line 340, in
main()
File "/home/user/miniconda/lib/python3.8/site-packages/torch/distributed/launch.py", line 326, in main
sigkill_handler(signal.SIGTERM, None) # not coming back
File "/home/user/miniconda/lib/python3.8/site-packages/torch/distributed/launch.py", line 301, in sigkill_handler
raise subprocess.CalledProcessError(returncode=last_return_code, cmd=cmd)
subprocess.CalledProcessError: Command '['/home/user/miniconda/bin/python', '-u', 'tools/trainval.py', '--local_rank=1', 'configs/trainval/daotad/daotad_i3d_r50_e700_thumos14_rgb.py', '--launcher', 'pytorch']' returned non-zero exit status 1.

@haritha91
Copy link
Author

Found the solution for this. yaml.load() without a Loader parameter has been depriciated. It should be added for vedacore/misc/checkpoint.py script as follows.

model_urls = yaml.load(open(file_path), Loader=yaml.FullLoader)

@yt2639
Copy link

yt2639 commented Nov 3, 2021

Hiii, thanks a lot for finding the bug! Did you manage to load the weights to the model? I'm having key mismatching etc problems as described here #14 . Do you have the same experience?

Thanks!

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

2 participants