chenruduan / OAReactDiff

An object-aware diffusion model for generating chemical reactions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnpicklingError: invalid load key, 'v' when loading from checkpoint

talipovm-nmsu opened this issue · comments

I've encountered an issue while following the tutorial provided in the Jupyter notebook, specifically when attempting to load the ddpm_trainer from a checkpoint.

The following code from the tutorial:

ddpm_trainer = DDPMModule.load_from_checkpoint(
    checkpoint_path="./pretrained-ts1x-diff.ckpt",
    map_location=device,
)

leads to the error message:
UnpicklingError: invalid load key, 'v'.

The issue occurs both after a local installation and when running inside a Docker container.

Any help would be greatly appreciated.

Thank you!

@talipovm-nmsu Thanks for your interest. The issue is likely due to the model checkpiont not being downloaded completely to your local repo as the git-lfs is used to distribute this "large" model checkpoint. A simple check is to look at the size of your local file. It should be around 300 MB.

The first answer in this channel should resolve this issue. https://stackoverflow.com/questions/33049688/what-causes-the-error-pickle-unpicklingerror-invalid-load-key

Thank you, Chenru! I followed your advice and downloaded the checkpoint file again, which resolved the issue.

Additionally, upon re-examining the Docker installation, I found that it doesn't exhibit this problem, so my initial assessment was incorrect.

Thanks for your support!