
本文共 4557 字,大约阅读时间需要 15 分钟。
���������������������������������������������������������������������������������HTML���������������Python������������������������������������������������������������������������������
������������������
������������������������������
������������������������������������������������HTML���������������������������������������������������Python���TensorFlow���������������������������������������������
������Python������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Python���TensorFlow���������������
- ������Python���������������
python --version
������������������������������������������ - ������TensorFlow���������������������������
import tensorflow as tf; print(tf.__version__)
������TensorFlow��������������������������������� - ������������������������������������
pip list
������TensorFlow������������������������������������
������Jupyter Notebook������������
���������������Jupyter Notebook���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������
������������TensorFlow������������������������������������������������HTML���������������������������������������������������������������������������������������������TensorFlow���������������������������������������������������������
������Python������
���������������������Python���������������������������������������������������������������python --version
������TensorFlow
������TensorFlow������������������������������������������������������pip install tensorflow
���������������������������
pip install tensorflow==1.15.0
������TensorFlow������������
���������������������������������������������TensorFlow������������������������������import tensorflow as tfprint(tf.__version__)
������TensorFlow������
������������������������������������TensorFlow������������������������������������������Python���������������import tensorflow as tf# ������������model = tf.keras.Sequential([ tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.MaxPooling2D(), tf.keras.layers.Dense(32, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10, activation='softmax')])# ���������������from tensorflow.keras.datasets import mnist(x_train, y_train), (x_test, y_test) = mnist.load_data()# ������������model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])#������������model.fit(x_train, y_train, batch_size=32, epochs=10, verbose=2)# ������������print("������������������: ", model.evaluate(x_test, y_test))
���������������������������������
TensorFlow��������������� pip ���������������������������������������������������������������������������������������������������������������������������������pip install -r requirements.txt
������������ requirements.txt
������������������������������������������������������
pip install numpypip install matplotlib
������Python������
������������������������������������Python������������������������������������������������������������������������������������������������
���������virtualenv
��� conda
������������������������������������������������������������������������������������������������������virtualenv myenvsource myenv/bin/activatepip install tensorflow
������������
������������
���������������TensorFlow���������Python���������������������������������������������������������������������������TensorFlow���������������������
���������������������TensorFlow���������������������������������������������������������������������������������������������TensorFlow���������������������������������������������������������
���������������������������TensorFlow������������������������������������������������TensorFlow������������������������������������������������������
������������������������������������TensorFlow���������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
