标签:from 训练 loading NPU loss install put val bsp
使用image前需安装pillow
pip install Pillow
from tensorflow.python.keras.preprocessing.image import load_img, img_to_array def main(): img = load_img("./images/img01.jpg", target_size=[300,300]) img = img_to_array(img) print(img) if __name__ == "__main__": main()
#创建神经网络模型 model = Sequential([ Flatten(input_shape=(28,28)), Dense(128,activation=tf.nn.relu), Dense(10,activation=tf.nn.softmax) ])
model的一些属性
1)compile
loss:
2)fit
3)evaluate
标签:from 训练 loading NPU loss install put val bsp
原文地址:https://www.cnblogs.com/dominik/p/13799187.html