import numpy as np
import tensorflow as tf
import os 
import glob
import argparse
import random
#from resnet import ResNet
import matplotlib.pyplot as plt
from tensorflow.keras.applications import ResNet50
from pysim import config
import importlib
importlib.reload(config)
import glob
import cv2
import shutil
from sklearn.preprocessing import LabelBinarizer, LabelEncoder
from sklearn.model_selection import train_test_split
import random
import pickle
from imutils import paths
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report
#from sklearn.linear_model import LogisticRegression
#from sklearn.metrics import classification_report

Fine-tuning is a multi-step process:

  • Remove the fully connected nodes at the end of the network (i.e., where the actual class label predictions are made).
  • Replace the fully connected nodes with freshly initialized ones.
  • Freeze earlier CONV layers earlier in the network (ensuring that any previous robust features learned by the CNN are not destroyed).
  • Start training, but only train the FC layer heads.
  • Optionally unfreeze some/all of the CONV layers in the network and perform a second pass of training.
imagesPaths = glob.glob(os.path.sep.join([config.ORIG_INPUT_DATASET, split, '*']))
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-84fef2878f7a> in <module>
----> 1 imagesPaths = glob.glob(os.path.sep.join([config.ORIG_INPUT_DATASET, split, '*']))

NameError: name 'split' is not defined