Skip to content

How to load the pretrained safesensor and continue to train? #13

Open

Description

@JunyuanDeng

Hello, Thanks for your sharing code!

I am now try to train the stage 2 with the provided vista.safetensors

So I change the command to below:

torchrun \
    --nnodes=1 \
    --nproc_per_node=8 \
    train.py \
    --base configs/training/vista_phase2_stage2.yaml \
    --finetune ${PATH_TO_STAGE1_CKPT}/vista.safetensors \
    --num_nodes 1 \
    --n_devices 8

But there are lots of missing keys like:
image

And the loss, in my expectation, should be low, which is not true in my observation:
image

I download the sampled video "samples_mp4_epoch00_batch0000_step000001.mp4":

samples_mp4_epoch00_batch0000_step000001.mp4

What should I do to use the provided weight to start the phase 2 stage 2 traning?

Activity

  1. Little-Podi commented on Jul 29, 2024

    @Little-Podi
    Collaborator

    Sorry for the trouble. I haven't verify this resuming feature yet. It seems that there are some random weights after initialization. Make sure the new weights are initialized as zeros. In addition, if there are some "unexpected" weights when loading the checkpoint, make sure all of them are remapped to "missing" weights. It can be realized by renaming the keys in the state dictionary and loading the dictionary to the model again.

  2. zhoujiawei3 commented on Nov 7, 2024

    @zhoujiawei3

    @JunyuanDeng
    Hi, have you resolved this issue? Could you please share how you did it? Thank you!

  3. zhoujiawei3 commented on Nov 10, 2024

    @zhoujiawei3

    @Little-Podi Hi,I want to make sure your words mean that we need to change the code to set the missing keys initialized as zeros in this case? As when I set these missing keys's value to zero, the samples_mp4_epoch00_batch0000_step000001.mp4 is still in that strange form

  4. jywu511 commented on Dec 25, 2024

    @jywu511

    @Little-Podi Hi, thanks a lot for sharing the great work! I met the same question, could you share the checkpoint after stage1 for continue training? Thanks a lot!

  5. zzz5y commented on Jan 8, 2025

    @zzz5y

    @Little-Podi Hi,I want to make sure your words mean that we need to change the code to set the missing keys initialized as zeros in this case? As when I set these missing keys's value to zero, the samples_mp4_epoch00_batch0000_step000001.mp4 is still in that strange form

    @zhoujiawei3 Hello,Do you find the answer about it?

  6. hungdche commented on Jan 21, 2025

    @hungdche

    Upon inspection, vista.safetensors does not appear to contain model_ema weights. I manually enable init_ema in this line and it seems to work.

  7. jywu511 commented on Mar 6, 2025

    @jywu511

    @hungdche, Hi, thanks for your response! Do you mean that we always set "model.reinit_ema()"?

  8. johnren-code commented on May 24, 2025

    @johnren-code

    Hello, When I finetune the LoRA layers using the pretrained weights, I meet such error:
    RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
    Do you know how to solve it? Sorry to bother you, Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions