Get the test runner operating again.
This commit is contained in:
@@ -1,43 +1,5 @@
|
||||
#import sys
|
||||
#import os
|
||||
#import glob
|
||||
#import socket
|
||||
#from keras.backend import GraphExecutionFunction
|
||||
|
||||
#sys.path.append('c:/git/keras')
|
||||
#sys.path.append('c:/git/absl')
|
||||
|
||||
# This upgrades all modules
|
||||
#py -mpip freeze | %{$_.split('==')[0]} | %{py -mpip install --upgrade $_}
|
||||
|
||||
|
||||
# The following worked to install CUDA for using tensorflow with GPU
|
||||
# 1) Install CUDA 11.8 Toolkit from here
|
||||
# https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local
|
||||
# 2) The binaries should wind up in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin
|
||||
# 3) Put the above path in the PATH environment variable
|
||||
# 4) Also download cuDNN from here https://developer.nvidia.com/cudnn because tensorflow will look for cudnn64_8.dll which is in that package
|
||||
# This download is just a bunch of DLLs with no install program. I left it in downloads folder.
|
||||
# 5) put C:\download\cuDNN\cudnn-windows-x86_64-8.9.7.29_cuda11-archive\bin in the PATH
|
||||
# 6) Run the check_gpu.py program and ensure no errors loading DLLs
|
||||
|
||||
|
||||
|
||||
|
||||
# installed version
|
||||
# py -m pip install keras==2.6.0
|
||||
# py -mpip install flask==2.0.1
|
||||
# py -mpip install numpy==1.19.5
|
||||
# py -mpip show numpy
|
||||
# py -mpip install tensorflow==2.6.0
|
||||
# py -mpip show tensorflow
|
||||
# py -mpip install matplotlib==3.4.3
|
||||
# c:\users\skess\appdata\local\programs\python\python39\lib\site-packages
|
||||
|
||||
import keras
|
||||
#from keras.preprocessing.image import ImageDataGenerator
|
||||
from keras.src.legacy.preprocessing.image import ImageDataGenerator
|
||||
|
||||
from flask import Flask, render_template, send_file, request
|
||||
import numpy as np
|
||||
import tensorflow
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
# import sys
|
||||
# import os
|
||||
# import glob
|
||||
|
||||
from keras.layers.pooling import MaxPool2D
|
||||
# from keras.layers.pooling import MaxPool2D
|
||||
|
||||
sys.path.append('c:/git/keras')
|
||||
sys.path.append('c:/git/absl')
|
||||
# sys.path.append('c:/git/keras')
|
||||
# sys.path.append('c:/git/absl')
|
||||
|
||||
# installed
|
||||
# py -mpip install numpy
|
||||
@@ -15,15 +15,34 @@ sys.path.append('c:/git/absl')
|
||||
# py -mpip install matplotlib
|
||||
# c:\users\skess\appdata\local\programs\python\python39\lib\site-packages
|
||||
|
||||
import keras
|
||||
from keras.preprocessing.image import ImageDataGenerator
|
||||
import numpy as np
|
||||
import tensorflow
|
||||
# import keras
|
||||
# from keras.preprocessing.image import ImageDataGenerator
|
||||
# import numpy as np
|
||||
# import tensorflow
|
||||
|
||||
#model_name='lenet5.h5'
|
||||
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
from keras.optimizers import SGD
|
||||
from keras.optimizers import Adam
|
||||
from tensorflow.keras.callbacks import TensorBoard
|
||||
import keras
|
||||
from keras.src.legacy.preprocessing.image import ImageDataGenerator
|
||||
from keras.callbacks import ModelCheckpoint
|
||||
from tensorflow.keras.callbacks import EarlyStopping
|
||||
import numpy as np
|
||||
import tensorflow
|
||||
from resnet50 import *
|
||||
import math
|
||||
from time import time
|
||||
|
||||
|
||||
print(os.getcwd())
|
||||
|
||||
model_name='../Weights/resnet50.h5'
|
||||
path = os.getcwd()
|
||||
model_name='Weights/resnet50_20241024_270.h5.keras'
|
||||
|
||||
# *************************************************** T E S T I N G ********************************************
|
||||
|
||||
@@ -49,7 +68,10 @@ model_name='../Weights/resnet50.h5'
|
||||
|
||||
# Load the model
|
||||
|
||||
model = keras.models.load_model(model_name)
|
||||
real_path = os.path.realpath(path + '/' + model_name)
|
||||
|
||||
print('Loading {model_name}'.format(model_name=real_path))
|
||||
model = keras.models.load_model(real_path)
|
||||
|
||||
# image_path='C:/boneyard/DeepLearning/IndividualValidationCases/SIG_0_Test_BollingerBand.jpg'
|
||||
# test_image = tensorflow.keras.preprocessing.image.load_img(image_path,color_mode='grayscale')
|
||||
@@ -72,8 +94,6 @@ model = keras.models.load_model(model_name)
|
||||
files=glob.glob("C:/boneyard/DeepLearning/IndividualValidationCases/*.jpg")
|
||||
#files=glob.glob("C:/boneyard/DeepLearning/data/VolatilityPriceContraction/*.jpg")
|
||||
|
||||
|
||||
|
||||
for file in files:
|
||||
test_image = tensorflow.keras.preprocessing.image.load_img(file,color_mode='grayscale')
|
||||
test_array = keras.preprocessing.image.img_to_array(test_image)
|
||||
|
||||
Reference in New Issue
Block a user