donut icon indicating copy to clipboard operation
donut copied to clipboard

How to load checkpoint?

Open Vadkoz opened this issue 3 years ago • 2 comments

I saved all my models during training and got 20 artifacts-v*.ckpt.

I loaded this checkpoint, but there is no model's state dicts. Where i can get it, and generally, how to load these checkpoints for testing? Or these checkpoints is only for optimizer?

Vadkoz avatar Apr 03 '23 19:04 Vadkoz

Hi @Vadkoz,

The current trainer removes state_dict in the ckpt files (check https://github.com/clovaai/donut/blob/1.0.9/train.py#L29-L31). However, it saves the model weights in HF's transformers format (check https://github.com/clovaai/donut/blob/1.0.9/lightning_module.py#L146-L150).

To load the model weights, you can pass the directory path (check https://github.com/clovaai/donut/blob/1.0.9/test.py#L22 and https://github.com/clovaai/donut/blob/1.0.9/donut/model.py#L578-L609).

I hope this information is helpful to you.

gwkrsrch avatar May 03 '23 01:05 gwkrsrch

@gwkrsrch Open the "Discussions" tab on this repo, then move non-issues over there. There are a lot of issues that are really questions, and better handled as discussion topics.

sandstrom avatar May 29 '23 16:05 sandstrom