简体   繁体   中英

MatplotlibDeprecationWarning: '.predictImage()' has been deprecated! Please use 'classifyImage()' instead

So I followed this blog to build Image Classification using ML, I had trained for 2 datasets, dogs and Pipes, and no matter which image I give it, it always says its 100% pipes with the following error,

To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
c:/Users/user1/Projects/firstCustomImageRecognit.py:12: MatplotlibDeprecationWarning: '.predictImage()' has been deprecated! Please use 'classifyImage()' instead.
  predictions, probabilities = prediction.predictImage("12.jpeg", result_count=3)
Pipes  :  100.0
dogs  :  0.0

Can anyone tell what needs to be done

As the Warning suggest use classifyImage() inplace of predictImage() , which is removed in latest version.

You can suppress the warning messages using

import logging, os
logging.disable(logging.WARNING)
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM