Skip to content

Commit

Permalink
moved to tensorflow.keras, moved to keras model format for storing th…
Browse files Browse the repository at this point in the history
…e model
  • Loading branch information
haverland committed Dec 22, 2024
1 parent d2c44cb commit e597a1d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion b2n/data/tmnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas as pd
from sklearn.utils import shuffle
from tensorflow import keras
from keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.preprocessing.image import ImageDataGenerator


def tmnist_percentals(input_dir="datasets", max_count=28 ):
Expand Down
2 changes: 1 addition & 1 deletion b2n/plotfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def plot_dataset_it(data_iter, columns=9, rows=5, nb_classes=100, classdecoding=
fig = plt.figure(figsize=(18, 11))

for i in range(1, columns*rows +1):
img, label = data_iter.next()
img, label = next(data_iter)
fig.add_subplot(rows, columns, i)
plt.xticks([0.2, 0.4, 0.6, 0.8])
plt.title(str(classdecoding(label[0].reshape(-1, nb_classes), nb_classes).reshape(-1)[0])) # set title
Expand Down
2 changes: 1 addition & 1 deletion prepare_data/digits-createimages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
" fig = plt.figure(figsize=(18, 11))\n",
" \n",
" for i in range(1, columns*rows +1):\n",
" img, label = data_iter.next()\n",
" img, label = next(data_iter)\n",
" fig.add_subplot(rows, columns, i)\n",
" plt.xticks([0.2, 0.4, 0.6, 0.8])\n",
" plt.title(np.argmax(label)/10) # set title\n",
Expand Down
4 changes: 2 additions & 2 deletions prepare_data/tenth of step of TMNIST-createimages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
],
"source": [
"from tensorflow import keras\n",
"from keras.preprocessing.image import ImageDataGenerator\n",
"from tensorflow.keras.preprocessing.image import ImageDataGenerator\n",
"\n",
"imgG = ImageDataGenerator()\n",
"ds = imgG.flow_from_directory(directory=output_dir, \n",
Expand Down Expand Up @@ -118,7 +118,7 @@
" fig = plt.figure(figsize=(18, 11))\n",
" \n",
" for i in range(1, columns*rows +1):\n",
" img, label = data_iter.next()\n",
" img, label = next(data_iter)\n",
" fig.add_subplot(rows, columns, i)\n",
" plt.xticks([0.2, 0.4, 0.6, 0.8])\n",
" plt.title(np.argmax(label)/10) # set title\n",
Expand Down

0 comments on commit e597a1d

Please sign in to comment.