Qnn+keras demo: ignore warnings

Hi,

Great demo with qnn+tf.keras. Is there a way to suppress the warnings below?

WARNING:tensorflow:You are casting an input of type complex128 to an incompatible dtype float32.  This will discard the imaginary part and may not be what you intended

I tried 3 different options but none worked:

  1. set verbose=0 in model.fit()
  2. set log level for tf:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
  1. using the warnings package:
import warnings
warnings.filterwarnings('ignore')

Instead use:

pip install tensorflow==2.8.1

nvm, found it:

tf.get_logger().setLevel('ERROR')

Hey @Hayk_Tepanyan! Thanks for the feedback :slight_smile:. Glad you found a solution :+1: