Code Monkey home page Code Monkey logo

golden-gaze's People

Contributors

dakezhang1998 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

arthurchen189

golden-gaze's Issues

Unable to load checkpoint

Loading the checkpoint file (https://github.com/UWaterlooIR/golden-gaze/releases/download/model/model.ckpt) in PyTorch Lightning raises the following error:

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
...
File ~/Repositories/master/code/health-retrieval/health_retrieval/modules/stance_detection.py:308, in GoldenGazeStanceDetector._lightning_model(self)
    306 @cached_property
    307 def _lightning_model(self) -> T5StanceDetector:
--> 308     return T5StanceDetector.load_from_checkpoint(str(self.model))

File ~/.local/share/virtualenvs/health-retrieval-SeINbd51/lib/python3.9/site-packages/pytorch_lightning/core/saving.py:139, in ModelIO.load_from_checkpoint(cls, checkpoint_path, map_location, hparams_file, strict, **kwargs)
    137         checkpoint = pl_load(checkpoint_path, map_location=map_location)
    138     else:
--> 139         checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage)
    141 if hparams_file is not None:
    142     extension = hparams_file.split(".")[-1]

File ~/.local/share/virtualenvs/health-retrieval-SeINbd51/lib/python3.9/site-packages/pytorch_lightning/utilities/cloud_io.py:47, in load(path_or_url, map_location)
     45 fs = get_filesystem(path_or_url)
     46 with fs.open(path_or_url, "rb") as f:RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
---> 47     return torch.load(f, map_location=map_location)

File ~/.local/share/virtualenvs/health-retrieval-SeINbd51/lib/python3.9/site-packages/torch/serialization.py:705, in load(f, map_location, pickle_module, **pickle_load_args)
    700 if _is_zipfile(opened_file):
    701     # The zipfile reader is going to advance the current file position.
    702     # If we want to actually tail call to torch.jit.load, we need to
    703     # reset back to the original position.
    704     orig_position = opened_file.tell()
--> 705     with _open_zipfile_reader(opened_file) as opened_zipfile:
    706         if _is_torchscript_zip(opened_zipfile):
    707             warnings.warn("'torch.load' received a zip file that looks like a TorchScript archive"
    708                           " dispatching to 'torch.jit.load' (call 'torch.jit.load' directly to"
    709                           " silence this warning)", UserWarning)

File ~/.local/share/virtualenvs/health-retrieval-SeINbd51/lib/python3.9/site-packages/torch/serialization.py:242, in _open_zipfile_reader.__init__(self, name_or_buffer)
    241 def __init__(self, name_or_buffer) -> None:
--> 242     super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))

To me it seems like the checkpoint might consist of multiple parts and maybe PyTorchLightning can't load it because some parts are missing. But that's just a wild guess.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.