Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,13 @@ from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, Dropout, Batc
|
|
| 7 |
from tensorflow.keras.models import Model
|
| 8 |
from tensorflow.keras.optimizers import Adam
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Pfad zum Verzeichnis der Bilddaten
|
| 11 |
base_dir = 'pokemon-images-first-generation17000-files/pokemon' # Pfad anpassen
|
| 12 |
|
|
|
|
| 7 |
from tensorflow.keras.models import Model
|
| 8 |
from tensorflow.keras.optimizers import Adam
|
| 9 |
|
| 10 |
+
# Function to find the greatest batch size that fully divides the total samples
|
| 11 |
+
def find_batch_size(total_samples, initial_batch_size):
|
| 12 |
+
for bs in range(initial_batch_size, 0, -1):
|
| 13 |
+
if total_samples % bs == 0:
|
| 14 |
+
return bs
|
| 15 |
+
return 1 # Fallback to 1 if no perfect divisor is found
|
| 16 |
+
|
| 17 |
# Pfad zum Verzeichnis der Bilddaten
|
| 18 |
base_dir = 'pokemon-images-first-generation17000-files/pokemon' # Pfad anpassen
|
| 19 |
|