0

I have a deep learning python code (Anaconda3, Ubuntu 16.04) which uses TensorFlow for some machine learning algorithms on video inputs. It imports the following packages:

import time, os, glob, subprocess
import skvideo.io
import numpy as np
import tensorflow as tf

import time, cv2, librosa
import skvideo.io
import numpy as np
import tensorflow as tf
from sklearn.externals import joblib

When running, it get the following warning. How can I remove this warning (or hide it from printing)?

/home/user/anaconda3/lib/python3.5/site-packages/sklearn/base.py:311: UserWarning: Trying to unpickle estimator SVC from version 0.18.1 when using version 0.19.1. This might lead to breaking code or invalid results. Use at your own risk.
  UserWarning)
Mary
  • 393
  • 1
  • 4
  • 17
  • which import actually gives the warning? – innisfree Nov 20 '17 at 22:40
  • anyhow, see e.g. https://stackoverflow.com/questions/14463277/how-to-disable-python-warnings – innisfree Nov 20 '17 at 22:40
  • 3
    Possible duplicate of [How to disable python warnings](https://stackoverflow.com/questions/14463277/how-to-disable-python-warnings) – innisfree Nov 20 '17 at 22:40
  • @innisfree sklearn! – Mary Nov 20 '17 at 22:42
  • 1
    Do as the warning says. Try downgrading your sklearn version to 0.18. I think there's some dependency in skvideo which requires 0.18 but your system has 0.19. Hence the warning. – Vivek Kumar Nov 21 '17 at 02:07
  • @VivekKumar and @others I was seeking an in-code solution. Something like @suppress in Java. Not using `-W ignore` flag when running. – Mary Nov 21 '17 at 16:12
  • But you should understand the version differences may also lead to inconsistent behaviour in pickling and unpickled objects – Vivek Kumar Nov 22 '17 at 04:41

0 Answers0