Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Disable all warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejw committed Jan 23, 2020
1 parent be0708c commit e9ebe9f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion connect_4/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default: run

run:
PYTHONPATH=. python3 cmd/play_with_human.py
TF_CPP_MIN_LOG_LEVEL=3 PYTHONPATH=. python3 cmd/play_with_human.py

train:
PYTHONPATH=. python3 cmd/train.py
Expand Down
23 changes: 23 additions & 0 deletions connect_4/cmd/play_with_human.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Disable all warnings from TensorFlow (Python side).
#
# - The order to disable warnings matters.
# - For CPP side, set # TF_CPP_MIN_LOG_LEVEL=3.

import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore",category=FutureWarning)

from tensorflow.python.util import deprecation
deprecation._PRINT_DEPRECATION_WARNINGS = False

import tensorflow as tf

# In addition, disable warning logging.
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)

from tensorflow import keras

##########################
# Real fun code starts.
##########################

import random

from game import GameConfig
Expand Down
2 changes: 1 addition & 1 deletion connect_4/docker/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

PYTHONPATH=. python3 cmd/play_with_human.py
TF_CPP_MIN_LOG_LEVEL=3 PYTHONPATH=. python3 cmd/play_with_human.py

0 comments on commit e9ebe9f

Please sign in to comment.