GraXpert icon indicating copy to clipboard operation
GraXpert copied to clipboard

GraXpert-3.0.2: PNG / TIFF exports fail denoise while FITS work

Open sophisticatedDreamer opened this issue 9 months ago • 5 comments

[Linux Ubuntu-22.04.x / Gimp-2.10 / GraXpert-3.0.2]

% ./GraXpert-linux/GraXpert --version
2024-05-17 17:08:31,196 MainProcess root INFO     GraXpert version: 3.0.2 release: Umbriel

A former successfully GraXpert-denoised PNG image was used as a layer in Gimp. After finishing all intended tweaks, I combined the visible layers and exported them into a PNG file.

Because new noise was introduced by another Gimp layer, I curiously fed this PNG to GraXpert again.

1st try - see attached log file "graxpert.log_1_PNG.log": The image loaded fast and fine. I did nothing else but clicking "Bild entrauschen" [Start Denoising]. After some seconds the following error box appeared:

"An error occured during denoising. Please see the log at /home/me/.cache/GraXpert/log/graxpert.log"

2nd try - see attached log file "graxpert.log_2_TIF.log": To narrow the error, I then exported the PNG out of Gimp into a TIFF file. This TIFF file showed the exact behavior and error message in GraXpert as the PNG file did.

3rd try - see attached log file "graxpert.log_3_FIT.log": Finally, I again exported the PNG out of Gimp, but this time into a **FITS'' file. Surprise! This FITS file appeard upside down (i.e. vertical mirrored) BUT the denoising works error free and fine as expected.

Summary: Those two files (PNF, TIFF) that yields the mentioned error both contain the exact same hint:

2024-05-17 17:38:27,116 MainProcess root INFO     Starting denoising
2024-05-17 17:38:28,180 MainProcess root INFO     Available inference providers : ['CUDAExecutionProvider', 'CPUExecutionProvider']
2024-05-17 17:38:28,180 MainProcess root INFO     Used inference providers : ['CPUExecutionProvider']
2024-05-17 17:38:28,182 MainProcess root ERROR    /home/runner/work/GraXpert/GraXpert/graxpert/denoising.py:106: RuntimeWarning: invalid value encountered in divide
2024-05-17 17:38:28,188 MainProcess root ERROR    [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: gen_input_image for the following indices
 index: 3 Got: 4 Expected: 3
 Please fix either the inputs/outputs or the model.
Traceback (most recent call last):
  File "/home/runner/work/GraXpert/GraXpert/graxpert/application/app.py", line 350, in on_denoise_request
  File "/home/runner/work/GraXpert/GraXpert/graxpert/denoising.py", line 118, in denoise
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 220, in run
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: gen_input_image for the following indices
 index: 3 Got: 4 Expected: 3
 Please fix either the inputs/outputs or the model.

So obviously index: 3 Got: 4 Expected: 3 is the culprit. graxpert.log_1_PNG.log graxpert.log_2_TIF.log graxpert.log_3_FIT.log

sophisticatedDreamer avatar May 17 '24 16:05 sophisticatedDreamer