Error on imwrite after several iterations of a loop.

조회 수: 2 (최근 30일)
Pattie Mathieu
Pattie Mathieu 2023년 4월 10일
답변: Sugandhi 2023년 5월 12일
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
Walter Roberson
Walter Roberson 2023년 4월 10일
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 2023년 4월 10일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

Sugandhi
Sugandhi 2023년 5월 12일
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.

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by