对新数据进行预测
最后,让我们使用我们的模型来分类没有包含在训练或验证集中的图像 。
【深度学习-tensorflow对花的品种进行分类】sunflower_url = "https://storage.googleapis.com/download.tensorflow.org/example_images/592px-Red_sunflower.jpg"sunflower_path = tf.keras.utils.get_file('Red_sunflower', origin=sunflower_url)img = keras.preprocessing.image.load_img(sunflower_path, target_size=(img_height, img_width))img_array = keras.preprocessing.image.img_to_array(img)img_array = tf.expand_dims(img_array, 0) # Create a batchpredictions = model.predict(img_array)score = tf.nn.softmax(predictions[0])print("This image most likely belongs to {} with a {:.2f} percent confidence.".format(class_names[np.argmax(score)], 100 * np.max(score)))
- Koa学习1:初始化项目
- 消息中间件学习-摘抄
- 十三 每天学习一个设计模式:行为型之责任链模式
- 学习3d建模达到什么水平能找到工作?次世代游戏建模需要学多久
- 【前端学习笔记day48】7.1
- 干货!吴恩达亲自为这份深度学习专项课程精炼图笔记点了赞!
- 2 Flink源码学习笔记 基于Yarn的自动伸缩容实现
- 不确定理论1
- 斯巴达 Kail学习笔记-kali信息搜集工具之Sparta
- 【C/C++ 数据结构 】广义表深度解析:从原理到C/C++实现