Learn practical skills, build real-world projects, and advance your career
import os
import tensorflow as tf
from tensorflow import keras
from keras import optimizers
from tensorflow.keras.models import Model, load_model, Sequential
from tensorflow.keras.applications import ResNet50
from tensorflow.keras.applications.resnet50 import preprocess_input
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.layers import Add, Dense, MaxPooling2D, GlobalAveragePooling2D, Dropout, Conv2D, Flatten
from tensorflow.keras.callbacks import EarlyStopping

print(tf.__version__)
print(tf.executing_eagerly())
tf.config.get_visible_devices()
2.2.0 True
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'),
 PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU'),
 PhysicalDevice(name='/physical_device:GPU:1', device_type='GPU')]
!pwd
/home/ahmad/VScode
!ls /home/ahmad/VScode/COVID-19-Radiography-Database/dataset/
COVID NORMAL 'Viral Pneumonia'
dir_path = "/home/ahmad/VScode/COVID-19-Radiography-Database/dataset/"
os.listdir(dir_path)
['NORMAL', 'Viral Pneumonia', 'COVID']