Error on imwrite after several iterations of a loop.

3 vues (au cours des 30 derniers jours)
Pattie Mathieu
Pattie Mathieu le 10 Avr 2023
I'm receiving these errors on a piece of code that has worked perfectly fine before. It seems to be originating from some subcommands of imwrite.
log4j:WARN No appenders could be found for logger (loci.formats.ClassList).
log4j:WARN Please initialize the log4j system properly.
The loop runs through several images before throwing this error. Why is it throwing this error only on some images? Is there a property of the images that I can change? Everything I've read seems to indicate that this is some kind of reporting system in certain matlab toolboxes, but I don't even know what's calling reporter, so the other solutions don't seem to be helpful.
  2 commentaires
Walter Roberson
Walter Roberson le 10 Avr 2023
https://www.mathworks.com/matlabcentral/answers/20354-report-generation-toolbox-gives-warnings-and-no-figures-in-r2011b#answer_82397
in particular the Java memory part
Pattie Mathieu
Pattie Mathieu le 10 Avr 2023
My Java memory is already set almost as high as my device memory already since I've had issues with running out of memory since I open some really large image files with this program. These files are nowhere near the size of the files that have crashed it before. At this point, I think I'm just switching out imwrite for Tiff

Connectez-vous pour commenter.

Réponses (1)

Sugandhi
Sugandhi le 12 Mai 2023
Hi Pattie Mathieu,
I understand that you are getting an error regarding log4j only on some images. It seems to be originating from some subcommands of "imwrite”.
The error message you are seeing is related to the log4j logging system and not directly related to the images being processed. It is indicating that the logging configuration has not been properly specified for the "loci.formats.ClassList" logger.
This error occurs when log4j fails to find an appender, which is a component responsible for handling the logging output. It's possible that this error only occurs with some images because the code may be hitting a different code path that triggers logging output in some cases and not in others.
To resolve this error, you need to properly configure the log4j logging system. This can be done by creating a log4j.properties file and placing it in your project's classpath. The file should contain log4j configuration properties that define appenders and loggers.
Here's an example log4j.properties file that defines a console appender and a root logger that has debug level logging:
log4j.rootLogger=DEBUG, consoleAppender
log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.consoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
You can customize this configuration to suit your needs and place it in your project's classpath. This should properly initialize the log4j system and prevent the error from occurring.

Produits


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by