agemagician / ProtTrans

ProtTrans is providing state of the art pretrained language models for proteins. ProtTrans was trained on thousands of GPUs from Summit and hundreds of Google TPUs using Transformers Models.
Academic Free License v3.0
1.13k stars 153 forks source link

Error downloading pre-trained model (prot_t5_xl_uniref50) #85

Closed zengzishuo closed 2 years ago

zengzishuo commented 2 years ago

Hi,

In ProtTrans/Embedding/TensorFlow/Advanced/ProtT5-XL-UniRef50.ipynb

The command

model = TFT5EncoderModel.from_pretrained("Rostlab/prot_t5_xl_uniref50", from_pt=True)

gives me the following error and I have no clue how to fix it, please help. Thanks in advance!

Traceback (most recent call last): File "", line 1, in File "/Users/zishuozeng/tf_env/lib/python3.8/site-packages/transformers/modeling_tf_utils.py", line 844, in from_pretrained return load_pytorch_checkpoint_in_tf2_model(model, resolved_archive_file, allow_missing_keys=True) File "/Users/zishuozeng/tf_env/lib/python3.8/site-packages/transformers/modeling_tf_pytorch_utils.py", line 93, in load_pytorch_checkpoint_in_tf2_model pt_state_dict = torch.load(pt_path, map_location="cpu") File "/Users/zishuozeng/tf_env/lib/python3.8/site-packages/torch/serialization.py", line 527, in load with _open_zipfile_reader(f) as opened_zipfile: File "/Users/zishuozeng/tf_env/lib/python3.8/site-packages/torch/serialization.py", line 224, in init super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: [enforce fail at inline_container.cc:143] . PytorchStreamReader failed reading zip archive: failed finding central directory frame #0: c10::ThrowEnforceNotMet(char const, int, char const, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, void const) + 191 (0x11077c0ff in libc10.dylib) frame #1: caffe2::serialize::PyTorchStreamReader::valid(char const, char const) + 115 (0x17a0c0b83 in libtorch.dylib) frame #2: caffe2::serialize::PyTorchStreamReader::init() + 315 (0x17a0bf95b in libtorch.dylib) frame #3: caffe2::serialize::PyTorchStreamReader::PyTorchStreamReader(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) + 143 (0x17a0bf79f in libtorch.dylib) frame #4: void pybind11::cpp_function::initialize<void pybind11::detail::initimpl::constructor<std::1::basic_string<char, std::__1::char_traits, std::1::allocator > >::execute<pybind11::class, 0>(pybind11::class&)::'lambda'(pybind11::detail::value_and_holder&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >), void, pybind11::detail::value_and_holder&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, pybind11::name, pybind11::is_method, pybind11::sibling, pybind11::detail::is_new_styleconstructor>(pybind11::class&&, void ()(pybind11::detail::value_and_holder&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, pybind11::detail::is_new_style_constructor const&)::'lambda'(pybind11::detail::function_call&)::operator()(pybind11::detail::function_call&) const + 147 (0x169c307c3 in libtorch_python.dylib) frame #5: pybind11::cpp_function::dispatcher(_object, _object, _object*) + 3382 (0x169628e66 in libtorch_python.dylib) frame #6: cfunction_call_varargs + 122 (0x1043c201a in python3.8) frame #7: _PyObject_MakeTpCall + 374 (0x1043c1a56 in python3.8) frame #8: method_vectorcall + 490 (0x1043c50aa in python3.8) frame #9: PyVectorcall_Call + 108 (0x1043c1dac in python3.8) frame #10: slot_tp_init + 319 (0x10441d53f in python3.8) frame #11: type_call + 292 (0x104418674 in python3.8) frame #12: _PyObject_MakeTpCall + 374 (0x1043c1a56 in python3.8) frame #13: call_function + 652 (0x1044a7b2c in python3.8) frame #14: _PyEval_EvalFrameDefault + 30253 (0x1044a422d in python3.8) frame #15: _PyEval_EvalCodeWithName + 3459 (0x1044a8b93 in python3.8) frame #16: _PyFunction_Vectorcall + 254 (0x1043c259e in python3.8) frame #17: _PyObject_FastCallDict + 268 (0x1043c18ac in python3.8) frame #18: _PyObject_Call_Prepend + 131 (0x1043c2fc3 in python3.8) frame #19: slot_tp_init + 180 (0x10441d4b4 in python3.8) frame #20: type_call + 292 (0x104418674 in python3.8) frame #21: _PyObject_MakeTpCall + 374 (0x1043c1a56 in python3.8) frame #22: call_function + 652 (0x1044a7b2c in python3.8) frame #23: _PyEval_EvalFrameDefault + 30422 (0x1044a42d6 in python3.8) frame #24: _PyEval_EvalCodeWithName + 3459 (0x1044a8b93 in python3.8) frame #25: _PyFunction_Vectorcall + 254 (0x1043c259e in python3.8) frame #26: call_function + 354 (0x1044a7a02 in python3.8) frame #27: _PyEval_EvalFrameDefault + 30610 (0x1044a4392 in python3.8) frame #28: _PyEval_EvalCodeWithName + 3459 (0x1044a8b93 in python3.8) frame #29: _PyFunction_Vectorcall + 254 (0x1043c259e in python3.8) frame #30: call_function + 354 (0x1044a7a02 in python3.8) frame #31: _PyEval_EvalFrameDefault + 30610 (0x1044a4392 in python3.8) frame #32: _PyEval_EvalCodeWithName + 3459 (0x1044a8b93 in python3.8) frame #33: _PyFunction_Vectorcall + 254 (0x1043c259e in python3.8) frame #34: method_vectorcall + 171 (0x1043c4f6b in python3.8) frame #35: call_function + 354 (0x1044a7a02 in python3.8) frame #36: _PyEval_EvalFrameDefault + 30610 (0x1044a4392 in python3.8) frame #37: _PyEval_EvalCodeWithName + 3459 (0x1044a8b93 in python3.8) frame #38: PyEval_EvalCode + 48 (0x10449cb60 in python3.8) frame #39: PyRun_InteractiveOneObjectEx + 689 (0x1044ef281 in python3.8) frame #40: PyRun_InteractiveLoopFlags + 169 (0x1044ee949 in python3.8) frame #41: PyRun_AnyFileExFlags + 60 (0x1044ee86c in python3.8) frame #42: Py_RunMain + 2640 (0x10450e970 in python3.8) frame #43: pymain_main + 406 (0x10450ed56 in python3.8) frame #44: Py_BytesMain + 43 (0x10450edab in python3.8) frame #45: start + 462 (0x20498452e in dyld) frame #46: 0x0 + 3 (0x3 in ???)

mheinzinger commented 2 years ago

I can not reproduce your error on my end. I have transformers=4.17.0, torch=1.10, python=3.7.9, cuda=11.6