【发布时间】:2021-05-11 06:46:14
【问题描述】:
我在使用tfio.experimental.image.decode_tiff 时不断收到以下警告。我发现它工作正常,但一直发出这些警告,我想禁止它。
TIFFFetchNormalTag: Warning, ASCII value for tag "DateTime" contains null byte in value; value incorrectly truncated during reading due to implementation limitations.
我是这样使用的:
string = tf.io.read_file(filename)
image = tfio.experimental.image.decode_tiff(string) # this line produces warning
如果我尝试使用warning 抑制警告,它似乎不起作用?它不会给我一个错误,但它什么也没做。
import warnings
warnings.filterwarnings('ignore', message='ASCII value for tag "DateTime" contains null byte in value; value incorrectly truncated during reading due to implementation limitations')
如何抑制此警告,或者解决产生警告的问题?
【问题讨论】:
-
有标准模块
warnings,你应该在谷歌上找到很多使用它的例子。 -
我试过了。在这种情况下它似乎不起作用,但也许我使用不正确。我已经更新了我的问题以包含它。
标签: python tensorflow warnings tensorflow-datasets suppress-warnings