IOS、Python自学心得30天 Day-3 TensorFlow 模组

前言:
最近需要用到训练模型来完成一些图片辨识,以 TensorFlow 来做为这次学习的重点,并参照了两个方式来实行这次的作业

正文:
从终端机安装 TensorFlow


# CPU
pip install tensorflow
# GPU
pip install tensorflow-gpu

pip install tensorflow_datasets

或是用Anaconda来安装

# CPU
conda install tensorflow
# GPU
conda install tensorflow-gpu

conda install tensorflow_datasets

程序码:
方案1

import numpy as np
import matplotlib.pyplot as plt

import tensorflow as tf
import tensorflow_datasets as tfds

from tensorflow.keras import layers

方案2

from tensorflow.python.keras import backend as K
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.layers import Flatten, Dense, Dropout
from tensorflow.python.keras.applications.resnet import ResNet50
from tensorflow.python.keras.optimizers import *
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator

numpy: 专门处理矩阵、向量的套件。
matplotlib.pyplot: 绘图套件。
tensorflow: 机器学习套件,可训练模型、存取模型。
tensorflow_datasets: 用以下载公开资料集 mnist。
tensorflow.keras: 专注於神经网路的机器学习套件,使用上比 tensorflow 更简单直观。


<<:  Day5 请多关怀边缘人

>>:  Transactions (5-1) - Serializability Isolation - Serial & 2PL

Day11. UX/UI 设计流程之一: Functional Map (以 Axure RP 实作)

有了 User Story,已经能够了解产品会有哪些角色、他们的需求及功能价值。但缺少的是这些需求...

[D10] placeholder for d10

写在前面 placeholder for d10 placeholder for d10 place...

[ Raspberry Pi ] Compute module 4 eMMC 烧录流程 ((CM4))

终於拿到手的Raspberry Pi Compute module 4 参考 官网 (确保电脑没有连...

Day25 - 如何在 Next.js 中正确地使用 lodash,使用 babel-plugin-import

前言 在前端通常会导入一些方便的 utility 函式库,以 lodash 来说,它是一个够帮我们处...

[Day 23] 资料产品在设计与开发阶段的五个大坑

过了需求访谈後,在设计和开发阶段也有要注意的事项。 第一坑 资料不熟悉 当组织规模一大,设计资料产品...