facebookresearch / nougat

Implementation of Nougat Neural Optical Understanding for Academic Documents
https://facebookresearch.github.io/nougat/
MIT License
8.81k stars 561 forks source link

Run error #143

Open kkll5875 opened 11 months ago

kkll5875 commented 11 months ago

error log: C:\Users\admin.conda\envs\pytorch\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\TensorShape.cpp:3484.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Traceback (most recent call last): File "C:\Users\admin.conda\envs\pytorch\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\admin.conda\envs\pytorch\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\admin.conda\envs\pytorch\Scripts\nougat.exe__main__.py", line 7, in File "C:\Users\admin.conda\envs\pytorch\lib\site-packages\predict.py", line 127, in main model = NougatModel.from_pretrained(args.checkpoint) File "C:\Users\admin.conda\envs\pytorch\lib\site-packages\nougat\model.py", line 684, in from_pretrained model = super(NougatModel, cls).from_pretrained( File "C:\Users\admin.conda\envs\pytorch\lib\site-packages\transformers\modeling_utils.py", line 3307, in from_pretrained ) = cls._load_pretrained_model( File "C:\Users\admin.conda\envs\pytorch\lib\site-packages\transformers\modeling_utils.py", line 3756, in _load_pretrained_model raise RuntimeError(f"Error(s) in loading state_dict for {model.class.name}:\n\t{error_msg}") RuntimeError: Error(s) in loading state_dict for NougatModel: size mismatch for decoder.model.model.decoder.embed_positions.weight: copying a param with shape torch.Size([4098, 1024]) from checkpoint, the shape in current model is torch.Size([3586, 1024]). You may consider adding ignore_mismatched_sizes=True in the model from_pretrained method.

about timm: (pytorch) C:\Users\admin\Desktop\tmp\1>pip list | findstr timm timm 0.5.4