Skip to content

Commit 30541f9

Browse files
committed
Small script to test if Tensorflow works properly.
1 parent 6b15658 commit 30541f9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

TryTensorFlow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import tensorflow as tf
2+
3+
cifar = tf.keras.datasets.cifar100
4+
(x_train, y_train), (x_test, y_test) = cifar.load_data()
5+
model = tf.keras.applications.ResNet50(
6+
include_top=True,
7+
weights=None,
8+
input_shape=(32, 32, 3),
9+
classes=100,)
10+
11+
loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False)
12+
model.compile(optimizer="adam", loss=loss_fn, metrics=["accuracy"])
13+
model.fit(x_train, y_train, epochs=5, batch_size=64)

0 commit comments

Comments
 (0)