# Wav2Vec2-XLSR-53

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-xlsr-53%2F6587%3E%5C
**Category:** Beginners\
**Created:** [June 5, 2021, 8:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-xlsr-53%2F6587 "2021-06-05T20:09:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![levant](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/levant/32/1733_2.png) [@levant](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flevant)%5C
**Post date:** [June 5, 2021, 8:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-xlsr-53%2F6587%2F1 "2021-06-05T20:09:43Z")

</div>

I tried to run notebook [facebook/wav2vec2-large-xlsr-53 · Hugging Face](https://huggingface.co/facebook/wav2vec2-large-xlsr-53)  
But when I run

```auto
model = Wav2Vec2ForCTC.from_pretrained(
    "facebook/wav2vec2-base-960h", 
    attention_dropout=0.1,
    hidden_dropout=0.1,
    feat_proj_dropout=0.0,
    mask_time_prob=0.05,
    layerdrop=0.1,
    gradient_checkpointing=True, 
    ctc_loss_reduction="mean", 
    pad_token_id=processor.tokenizer.pad_token_id,
    vocab_size=len(processor.tokenizer)
)

```

I get this error

```auto
RuntimeError: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at ../caffe2/serialize/inline_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at ../caffe2/serialize/inline_container.cc:132)
frame #0: c10::Error::Error(c10::SourceLocation, std:: __1::basic_string<char, std::__ 1::char_traits<char>, std::__1::allocator<char> > const&) + 135 (0x14e2f6787 in libc10.dylib)
frame #1: caffe2::serialize::PyTorchStreamReader::init() + 2350 (0x13795414e in libtorch.dylib)
frame #2: caffe2::serialize::PyTorchStreamReader::PyTorchStreamReader(std:: __1::basic_string<char, std::__ 1::char_traits<char>, std::__1::allocator<char> > const&) + 143 (0x13795379f in libtorch.dylib)
frame #3: void pybind11::cpp_function::initialize<void pybind11::detail::initimpl::constructor<std:: __1::basic_string<char, std::__ 1::char_traits<char>, std::__1::allocator<char> > >::execute<pybind11::class_<caffe2::serialize::PyTorchStreamReader>, 0>(pybind11::class_<caffe2::serialize::PyTorchStreamReader>&)::'lambda'(pybind11::detail::value_and_holder&, std::__1::basic_string<char, std:: __1::char_traits<char>, std::__ 1::allocator<char> >), void, pybind11::detail::value_and_holder&, std:: __1::basic_string<char, std::__ 1::char_traits<char>, std::__1::allocator<char> >, pybind11::name, pybind11::is_method, pybind11::sibling, pybind11::detail::is_new_style_constructor>(pybind11::class_<caffe2::serialize::PyTorchStreamReader>&&, (*)(0...), void pybind11::detail::initimpl::constructor<std::__1::basic_string<char, std:: __1::char_traits<char>, std::__ 1::allocator<char> > >::execute<pybind11::class_<caffe2::serialize::PyTorchStreamReader>, 0>(pybind11::class_<caffe2::serialize::PyTorchStreamReader>&)::'lambda'(pybind11::detail::value_and_holder&, std:: __1::basic_string<char, std::__ 1::char_traits<char>, std::__1::allocator<char> >) const&...)::'lambda'(pybind11::detail::function_call&)::operator()(pybind11::detail::function_call&) const + 147 (0x1346277c3 in libtorch_python.dylib)
frame #4: pybind11::cpp_function::dispatcher(_object*, _object*, _object*) + 3382 (0x13401fe66 in libtorch_python.dylib)
<omitting python frames>

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
<ipython-input-108-5337759b7278> in <module>
      1 from transformers import Wav2Vec2ForCTC
      2 
----> 3 model = Wav2Vec2ForCTC.from_pretrained(
      4 #"facebook/wav2vec2-base-960h",
      5 "facebook/wav2vec2-large-xlsr-53",

/opt/anaconda3/lib/python3.8/site-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
   1062 state_dict = torch.load(resolved_archive_file, map_location="cpu")
   1063 except Exception:
-> 1064 raise OSError(
   1065 f"Unable to load weights from pytorch checkpoint file for '{pretrained_model_name_or_path}' "
   1066 f"at '{resolved_archive_file}'"

OSError: Unable to load weights from pytorch checkpoint file for 'facebook/wav2vec2-large-xlsr-53' at '/Users/elizavetatrusova/.cache/huggingface/transformers/5d2a20b45a1689a376ec4a6282b9d9be42f931cdf8daf07c3668ba1070a059d9.db2a69eb44bf7b1efcfff155d4cc22155230bd8c0941701b064e9c17429a623d'If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. 

```

I run it in Jupyter, what can I do with it?

---

<div class="post-metadata">

**Author:** ![tadf](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@tadf](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftadf)%5C
**Post date:** [June 7, 2021, 8:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-xlsr-53%2F6587%2F2 "2021-06-07T08:15:01Z")

</div>

Perhaps it’s a permissions error?

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpatrickvonplaten)%5C
**Post date:** [March 18, 2022, 4:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-xlsr-53%2F6587%2F3 "2022-03-18T16:37:13Z")

</div>

Hmm, the code works for me and there shouldn’t be a permission error - could you try again?
