-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't save local toml files; add tensorflow tests.
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# test for tensorflow install. | ||
|
||
try: | ||
import tensorflow as tf | ||
except: | ||
raise ImportError("tensorflow is not installed.") | ||
print(f"Testing tensorflow version: {tf.__version__}") | ||
cifar = tf.keras.datasets.cifar100 | ||
(x_train, y_train), (x_test, y_test) = cifar.load_data() | ||
model = tf.keras.applications.ResNet50( | ||
include_top=True, | ||
weights=None, | ||
input_shape=(32, 32, 3), | ||
classes=100,) | ||
|
||
loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False) | ||
model.compile(optimizer="adam", loss=loss_fn, metrics=["accuracy"]) | ||
print(" Tensorflow - starting fit") | ||
model.fit(x_train, y_train, epochs=5, batch_size=64) | ||
print(" Tensorflow test complete.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters