starik222 / BooruDatasetTagManager

MIT License
1.45k stars 124 forks source link

[BUG] Tags disappear on some event #104

Closed LjeDamos closed 6 months ago

LjeDamos commented 11 months ago

Don't know for sure why, but most tags disappear from random images, only remaining ones are those which was added through "add tag to all".

Got like 4 of those occurred in my dataset out of ~600 pairs.

Guess that didn't happen on previous versions (like < 2.0.0). Currently using this release - e80208a81122d5a6bed9d1215fe7e5d8c3018c58 (2.0.2)

jojje commented 8 months ago

Yes, I've noticed that bug as well. It will seemingly wipe all tags from the affected random image. Only during training did I notice some images had blank caption files. For now I've created a "cron-job" that automatically backs up all the tags in the current workspace folder, so that I'll suffer minimal data loss. Have yet to discover some pattern that triggers this data corruption (destruction), so can't really offer any additional details other than to confirm this happens randomly to me as well.

starik222 commented 8 months ago

Version 2.1.1 adds an additional check of saved data that may help find the source of the problem. If the tags do not disappear from the program itself (visible in the tags table), then this check will show an error and generate debugging data.

catmanc commented 8 months ago

ErrorData.json

I have the same problem in both 2.1.1 and 2.1.2

starik222 commented 8 months ago

ErrorData.json

I have the same problem in both 2.1.1 and 2.1.2

Thank you, this is an error in the verification algorithm itself, when, due to the difference in the ' ' and '_' characters, the verification led to a false error. Fixed in 2.1.3

catmanc commented 8 months ago

Thank you, this is an error in the verification algorithm itself, when, due to the difference in the ' ' and '_' characters, the verification led to a false error. Fixed in 2.1.3

Thank you for your quick response, but still got the same issue... ErrorData.json

jojje commented 8 months ago

Yes, same here. However I've failed to detect the precise point at which the tags were deleted, so don't have an ErrorData to share that captures the specific event. The data loss is typically discovered much later, either when I happen to scroll by an image that now have zero tags, or when I've accidentally saved the work, causing the caption files to be updated on disk and discovering some of them are zero bytes in size.

I'll create a directory scanner for zero-byte files, so I'm alerted directly when this problem occurs. Unfortunately that means I'll have to "CTRL+S" after each UI interaction as otherwise what's captured in the ErrorData file will be some other operation overwriting the actual event that caused the bug.

LjeDamos commented 7 months ago

Looks like it just removed tags on image when i replaced tag in all images. Btw, where i can get the ErrorData log?

Using this release https://github.com/starik222/BooruDatasetTagManager/commit/25da3b318efb6378eb61bc1b008bcc63c0ed52dd (v2.1.4)

starik222 commented 7 months ago

Looks like it just removed tags on image when i replaced tag in all images. Btw, where i can get the ErrorData log?

Using this release 25da3b3 (v2.1.4)

Did you get an error message when saving? ErrorData.json is generated only when an error occurs and is located in the program folder.

LjeDamos commented 7 months ago

Looks like it just removed tags on image when i replaced tag in all images. Btw, where i can get the ErrorData log? Using this release 25da3b3 (v2.1.4)

Did you get an error message when saving? ErrorData.json is generated only when an error occurs and is located in the program folder.

Apparently i didnt save the changes, simply opened the image in folder and replaced tags back from file. Will try next time. Ty for response.

neojam commented 7 months ago

Experienced this a quite few times as well in v2+ versions. Last time several times in v2.1.4.0. There is no error message when this happens. Images that previously had tags, just randomly loose all of them. In most cases you find about the loss much later, when you come across images with 0 or very few tags (tags that were added later after the tag list was emptied and you didnt notice it and kept on adding tags to all images).

After editing tags with BDTM, i now always check the filessizes of txt-files (if those are under 50bytes, then there was probably loss of all tags at some point).

Happened a few times today too. I believe its somehow related to "Multi-tag filtering mode". I did filter with "NOT" and was deleting and adding tags when i noticed missing tags in an image

starik222 commented 6 months ago

Fixed in 2.1.5