-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for TF 2.16.1 stable, Ready for release.
- Loading branch information
Showing
7 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
''' | ||
********************************************** | ||
* SpectraKeras_CNN Classifier and Regressor | ||
* v2024.03.03.1 | ||
* v2024.03.08.1 | ||
* Uses: TensorFlow | ||
* By: Nicola Ferralis <[email protected]> | ||
********************************************** | ||
|
@@ -223,7 +223,7 @@ def main(): | |
def train(learnFile, testFile, flag): | ||
dP = Conf() | ||
import tensorflow as tf | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow.keras as keras | ||
else: | ||
if dP.kerasVersion == 2: | ||
|
@@ -791,7 +791,7 @@ def printParam(): | |
def plotActivationsTrain(model): | ||
import matplotlib.pyplot as plt | ||
import tensorflow as tf | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow.keras as keras | ||
else: | ||
if dP.kerasVersion == 2: | ||
|
@@ -824,7 +824,7 @@ def plotActivationsTrain(model): | |
def plotActivationsPredictions(R, model): | ||
print(" Saving activation plots...\n") | ||
import matplotlib.pyplot as plt | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow as tf | ||
import tensorflow.keras as keras | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
''' | ||
********************************************** | ||
* libSpectraKeas - Library for SpectraKeras | ||
* v2024.03.03.1 | ||
* v2024.03.08.1 | ||
* Uses: TensorFlow | ||
* By: Nicola Ferralis <[email protected]> | ||
********************************************** | ||
|
@@ -87,14 +87,14 @@ def loadModel(dP): | |
model = tflite.Interpreter(model_path=os.path.splitext(dP.model_name)[0]+'_edgetpu.tflite', | ||
experimental_delegates=[tflite.load_delegate(dP.edgeTPUSharedLib,{})]) | ||
except: | ||
print(" Coral Edge TPU not found. Please make sure it's connected and Tflite-runtime is v2.11.1 or lower.") | ||
print(" Coral Edge TPU not found. Please make sure it's connected and Tflite-runtime matches the TF version that is installled.") | ||
else: | ||
model = tflite.Interpreter(model_path=os.path.splitext(dP.model_name)[0]+'.tflite') | ||
model.allocate_tensors() | ||
else: | ||
getTFVersion(dP) | ||
import tensorflow as tf | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow.keras as keras | ||
else: | ||
if dP.kerasVersion == 2: | ||
|
@@ -187,7 +187,7 @@ def representative_dataset_gen(): | |
#************************************ | ||
def plotWeights(dP, En, A, model, type): | ||
import matplotlib.pyplot as plt | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow as tf | ||
import tensorflow.keras as keras | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
''' | ||
********************************************** | ||
* SpectraKeras_CNN Classifier and Regressor | ||
* v2024.03.03.1 | ||
* v2024.03.08.1 | ||
* Uses: TensorFlow | ||
* By: Nicola Ferralis <[email protected]> | ||
********************************************** | ||
|
@@ -223,7 +223,7 @@ def main(): | |
def train(learnFile, testFile, flag): | ||
dP = Conf() | ||
import tensorflow as tf | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow.keras as keras | ||
else: | ||
if dP.kerasVersion == 2: | ||
|
@@ -791,7 +791,7 @@ def printParam(): | |
def plotActivationsTrain(model): | ||
import matplotlib.pyplot as plt | ||
import tensorflow as tf | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow.keras as keras | ||
else: | ||
if dP.kerasVersion == 2: | ||
|
@@ -824,7 +824,7 @@ def plotActivationsTrain(model): | |
def plotActivationsPredictions(R, model): | ||
print(" Saving activation plots...\n") | ||
import matplotlib.pyplot as plt | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow as tf | ||
import tensorflow.keras as keras | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
''' | ||
********************************************** | ||
* SpectraKeras_MLP Classifier and Regressor | ||
* v2024.03.03.1 | ||
* v2024.03.08.1 | ||
* Uses: TensorFlow | ||
* By: Nicola Ferralis <[email protected]> | ||
********************************************** | ||
|
@@ -199,7 +199,7 @@ def main(): | |
def train(learnFile, testFile): | ||
dP = Conf() | ||
import tensorflow as tf | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow.keras as keras | ||
else: | ||
if dP.kerasVersion == 2: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
''' | ||
********************************************** | ||
* libSpectraKeas - Library for SpectraKeras | ||
* v2024.03.03.1 | ||
* v2024.03.08.1 | ||
* Uses: TensorFlow | ||
* By: Nicola Ferralis <[email protected]> | ||
********************************************** | ||
|
@@ -87,14 +87,14 @@ def loadModel(dP): | |
model = tflite.Interpreter(model_path=os.path.splitext(dP.model_name)[0]+'_edgetpu.tflite', | ||
experimental_delegates=[tflite.load_delegate(dP.edgeTPUSharedLib,{})]) | ||
except: | ||
print(" Coral Edge TPU not found. Please make sure it's connected and Tflite-runtime is v2.11.1 or lower.") | ||
print(" Coral Edge TPU not found. \n Please make sure it's connected and Tflite-runtime matches the TF version that is installled.") | ||
else: | ||
model = tflite.Interpreter(model_path=os.path.splitext(dP.model_name)[0]+'.tflite') | ||
model.allocate_tensors() | ||
else: | ||
getTFVersion(dP) | ||
import tensorflow as tf | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow.keras as keras | ||
else: | ||
if dP.kerasVersion == 2: | ||
|
@@ -187,7 +187,7 @@ def representative_dataset_gen(): | |
#************************************ | ||
def plotWeights(dP, En, A, model, type): | ||
import matplotlib.pyplot as plt | ||
if checkTFVersion("2.15.99"): | ||
if checkTFVersion("2.16.0"): | ||
import tensorflow as tf | ||
import tensorflow.keras as keras | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ include = [ | |
|
||
[project] | ||
name = "SpectraKeras" | ||
version = "v2024.03.03.1" | ||
version = "v2024.03.08.1" | ||
dependencies = ["numpy", "h5py", "tensorflow", "pydot", "graphviz","scipy","tf-keras"] | ||
authors = [{ name="Nicola Ferralis", email="[email protected]" },] | ||
description = "Machine learning for scientific spectra" | ||
|