Skip to content

Commit

Permalink
Move tensorflow import inside function scopes #51
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Nepstad committed Oct 28, 2020
1 parent a6b65e0 commit c3a4f70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pysilcam/silcam_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
import pandas as pd
import scipy
import tensorflow.keras as keras

'''
SilCam TensorFlow analysis for classification of particle types
Expand Down Expand Up @@ -67,6 +66,8 @@ def load_model(model_path):
Returns:
model (tf model object) : loaded tf.keras model from load_model()
'''
import tensorflow.keras as keras

path, filename = os.path.split(model_path)
header = pd.read_csv(os.path.join(path, 'header.tfl.txt'))
class_labels = header.columns
Expand Down
2 changes: 1 addition & 1 deletion pysilcam/tests/test_z_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import numpy as np
import unittest
import tensorflow as tf

# Get user-defined path to unittest data folder
ROOTPATH = os.environ.get('UNITTEST_DATA_PATH', None)
Expand All @@ -25,6 +24,7 @@ def test_classify():
@todo include more advanced testing of the classification feks. assert values in a confusion matrix.
'''
import tensorflow as tf

# location of the training data
database_path = os.path.join(ROOTPATH, 'silcam_classification_database')
Expand Down

0 comments on commit c3a4f70

Please sign in to comment.