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

Something wrong with the model file? #27

Closed
AnkushMalaker opened this issue Nov 22, 2024 · 2 comments
Closed

Something wrong with the model file? #27

AnkushMalaker opened this issue Nov 22, 2024 · 2 comments

Comments

@AnkushMalaker
Copy link

I get an unpickling error while following the steps on the README to setup the env, ie,

  1. Create a .venv with python3 -m venv .venv. Source it.
  2. Install current project with pip install .
  3. Use specified command: reverb --model reverb_asr_v1 --audio_file audio.mp3 --result_dir results
  warnings.warn(
Traceback (most recent call last):
  File "/path/to/venv/bin/reverb", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/path/to/reverb/asr/wenet/bin/recognize_wav.py", line 165, in main
    reverb_model = load_model(args.model)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/reverb/asr/wenet/cli/reverb.py", line 354, in load_model
    return ReverbASR(
           ^^^^^^^^^^
  File "/path/to/reverb/asr/wenet/cli/reverb.py", line 78, in __init__
    self.model, self.configs = init_model(self, self.configs)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/reverb/asr/wenet/utils/init_model.py", line 240, in init_model
    infos = load_checkpoint(model, args.checkpoint, def_strict=False)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/reverb/asr/wenet/utils/checkpoint.py", line 35, in load_checkpoint
    global_checkpoint = torch.load(path, map_location='cpu')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.12/site-packages/torch/serialization.py", line 1040, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.12/site-packages/torch/serialization.py", line 1258, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_pickle.UnpicklingError: invalid load key, 'v'.

@strider1551
Copy link

Do you have git lfs correctly setup before pip install .? I ran into the same error when downloading the asr model directly with git clone https://huggingface.co/Revai/reverb-asr and discovered that something wasn't right with git lfs. Instead of downloading the roughly 2Gb model, it downloaded a placeholder of some sort.

@AnkushMalaker
Copy link
Author

That was it, thanks!
Setup git lfs again and cloned manually, it works now.

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