nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Unable to load image caption model after failure

Open sevapopov2 opened this issue 1 month ago • 8 comments

Brief summary

I tried to load image caption model once when tried one of first alfas of 2026.1. The model doesn't load since then and every time I try to enable image caption again it fails immediately.

Steps to reproduce

  1. Launch NVDA
  2. Enable image caption and make that it fails to load the model
  3. Disable and enable image caption in settings dialog or press Ins+g and press yes button in the dialog

Actual behavior

Image caption loading fails immediately.

Expected behavior

There should be a way to reload the model if it failed. Maybe I should remove something from user config for it to work as expected.

NVDA logs, crash dumps and other attachments

Image model loading failure.log

NVDA type

portable copy

NVDA version

alpha-53667,bc2647d0

Have you tried any other versions of NVDA? If so, please report their behaviors.

it was reproduced in alpha-52937,f535af1f first time and then it doesn't work in each alfa.

Windows version

Windows 11 25H2

Name and version of other software in use when reproducing the issue

No response

Other information about your system

The first time I tried to load the image model it couldn't load, probably due to restrictions we can currently face with connecting to different services. Model doesn't load again when I connect to VPN, however maybe I need to remove something from config.

Does the issue still occur after restarting your computer?

I have restarted my computer and the issue still occurs

If NVDA add-ons are disabled, is your problem still occurring?

I have restarted NVDA with add-ons disabled and the issue still occurs

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

I have run the COM Registration Fixing Tool and the issue still occurs

sevapopov2 avatar Nov 28 '25 14:11 sevapopov2

I was able to find and remove the model to redownload it, but there is an issue that the model cannot be downloaded from Russia. However, NVDA updates are downloading fine and add-on store opens and works as expected. Can this be solved? Also, it would be good to have an option to retry model downloading in settings or maybe there can be an information how to remove the model in the user guide or the way to remove it from GUI. Thank you!

sevapopov2 avatar Nov 28 '25 15:11 sevapopov2

onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from C:\NVDA-snapshot\userConfig\models\Xenova/vit-gpt2-image-captioning/onnx/encoder_model_quantized.onnx failed:E:_work\1\s\onnxruntime\core\graph\model.cc:166 onnxruntime::Model::Model ModelProto does not have a graph.

It seems that the model was not fully downloaded, and the download code lacks the necessary integrity checks. Try deleting the models folder in userConfig and downloading it again. The default model files come from Hugging Face. You can try using a VPN or a mirror source to download them.

tianzeshi-study avatar Nov 28 '25 17:11 tianzeshi-study

Additionally, managing model downloads and deletions through the GUI, as well as providing mirror sources configuration for regions that cannot access Hugging Face, are features planned for the model manager.

tianzeshi-study avatar Nov 28 '25 17:11 tianzeshi-study

It seems that the model was not fully downloaded, and the download code lacks the necessary integrity checks. Try deleting the models folder in userConfig and downloading it again. The default model files come from Hugging Face. You can try using a VPN or a mirror source to download them.

Thank you! Yes, I deleted the folder and redownloaded the model with VPN. Is there a way now to set the mirror in case the model can be updated in the future alfa versions?

sevapopov2 avatar Nov 28 '25 18:11 sevapopov2

At the moment, it isn’t possible to change the mirror source without modifying the source code.

Also, in most cases the model itself will not be updated; instead, new types of models will be added in the future through the model manager.

tianzeshi-study avatar Nov 29 '25 05:11 tianzeshi-study

@tianzeshi-study - please add download clearing and integrity checks. You can look at the add-on store downloader for examples.

seanbudd avatar Dec 04 '25 03:12 seanbudd

@tianzeshi-study - please add download clearing and integrity checks. You can look at the add-on store downloader for examples.

There is no need to delete the existing files, because the model supports resuming downloads.

As for integrity checking, where should the file hash be stored? Should it be hard-coded into the downloader? Perhaps after the model manager is implemented, the model file hash and the model metadata can be stored together.

tianzeshi-study avatar Dec 07 '25 12:12 tianzeshi-study

@tianzeshi-study - but if the integrity check fails and the download is broken we need a way to delete the files. Is there a way to fetch the current hash from huggingface? Will the model files change in future? If the model files won't change, hard coding the hash is fine

seanbudd avatar Dec 08 '25 00:12 seanbudd