DeclanRussell / NvidiaAIDenoiser

A simple implementation of Nvidia's AI denoiser
MIT License
398 stars 52 forks source link

Error "Could not save file" for unknown reason #16

Closed thargor6 closed 4 years ago

thargor6 commented 4 years ago

Hi, a user of my software ( https://jwildfire.overwhale.com/, which can use the denoiser as optional feature ) reported that he gets a write error. We have tried to analyse the problem, but could not find the reason.

Everything works fine until saving (other software can write to this folder, and the folder is not full, the file is also not open etc.):

Launching NVidia AI Denoiser... Created by Declan Russell... Input image: ... (some png-file) Load successfully Output image: ... (different png-file) Denoising... Denoising complete in ... Saving to .. Could not save file ... [OIIO]: Could not open file...

Any ideas?

DeclanRussell commented 4 years ago

Hmm I haven't hit this before personally. Its tricky to know without more information. It could perhaps be a permissions issue, or the file could already been open by some other program. If not either of these perhaps something to do with the requested file name? I know windows has some limitations in what you can name files on disk. Do you have a way to reproduce this issue?

thargor6 commented 4 years ago

I could not reproduce it, unfortunately. It seems not to be some obvious reason (the file is not in use because it does not exist; it is not a permission problem because it also occurs as admin; the filename is harmless and not too long ("testpic.png")). Could it be some component which is missing to write png-files (I do not know how this OIIO-stuff works)?

burrburr commented 4 years ago

Hello, I'm the guy with the problem. If you need me to test or try anything in order to get some more info about the problem, let me know.

DeclanRussell commented 4 years ago

@thargor6 How are you shipping the denoiser in your application? The way I have deployed the binary is so that all the dlls required to link with are next to the executable so that they can be found. Are an missing perhaps?

Hey @burrburr, is the issue only a problem with PNG files or is it an issue with any file format? What happens if you use the standalone app? (download and some instructions how to use it here )

DeclanRussell commented 4 years ago

Also just a little prior warning, apologies if my replies are a little slow over the next couple of weeks. These couple of weeks prior to SIGGRAPH are really busy!

thargor6 commented 4 years ago

Hi, I'm shipping complete folder of the denoiser (and a lot of user are already using and loving it). Hmm, but maybe some crazy antivirus has removed some of the files because it feels bad about .dll's. @burrburr Could you please verify if there is a sub folder "Denoiser_2.4" with 37 files (a lot of .dll's) inside your JWildfire-folder?

burrburr commented 4 years ago

Sorry for the late reply!!! (Works been bananas) @DeclanRussell Anyways, I tried the denoiser by itself with a couple of different images with the inputs and outputs in different places (pictures folder for one test and in the temp folder in app data for another), and in both scenarios it worked liked a charm.

@thargor6 Additionally, I looked in the denoiser 2.4 folder under the lib folder and there are 39 items total. When compared to the og denoiser, there are two additional cache files (cache.db and cache7.db). When I remove these two items and run JWild, no change occurs; furthermore, if I run the diagnostics test again after removing the .db files (aren't created every time just removed once) I get the same results as in earlier tests (attached). diagnostics.txt

burrburr commented 4 years ago

@thargor6 @DeclanRussell I'm not sure as to how/why this works, but I took all of the files from the denoiser 2.4 folder under JWild and moved them elsewhere and replaced them with the files from the OG denoiser 2.4. This, for some reason, allows the denoiser to work properly. So how 'bout that :) Attched is the re-run diagnostics file

diagnostics.txt

DeclanRussell commented 4 years ago

Weird! Perhaps something got corrupted somewhere idk. Glad you found a solution though! :)

thargor6 commented 4 years ago

OK, then it seems to have nothing to do with the Denoiser itself and we can close the issue (maybe it is even a virus which has corrupted the files or the permissions where changed when extracting the archieve, or ...)

@burrburr If you find something out (e. g. after comparing the files), it would be interesting to know, so feel welcome to post the solution in the JWildfire forum.

Cheers!