Skip to content
Snippets Groups Projects
Commit fc3b2dc1 authored by tomrink's avatar tomrink
Browse files

minor

parent 5a8ce72b
No related branches found
No related tags found
No related merge requests found
# To support both python 2 and python 3 # To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals from __future__ import division, print_function, unicode_literals
import os import os, sys
from pathlib import Path from pathlib import Path
...@@ -29,12 +29,20 @@ cachepath = cachepath+'.pkl' ...@@ -29,12 +29,20 @@ cachepath = cachepath+'.pkl'
try: try:
user_paths = os.environ['PYTHONPATH'].split(os.pathsep) user_paths = os.environ['PYTHONPATH'].split(os.pathsep)
python_path = user_paths[0] + os.sep python_path = None
if len(user_paths) > 1:
for up in user_paths:
if up.find('cimss_icing') > 0:
python_path = up + os.sep
else:
python_path = user_paths[0] + os.sep
if python_path is None:
print('** No PYTHONPATH found containing cimss_icing/model *', file=sys.stderr)
ancillary_path = python_path + 'ancillary' + os.sep ancillary_path = python_path + 'ancillary' + os.sep
model_path_day = python_path + 'tf_model_day' + os.sep model_path_day = python_path + 'tf_model_day' + os.sep
model_path_night = python_path + 'tf_model_night' + os.sep model_path_night = python_path + 'tf_model_night' + os.sep
except KeyError: except KeyError:
print('** PYTHONPATH must be defined! *') print('** PYTHONPATH must be defined! *', file=sys.stderr)
python_path = None python_path = None
gpu_devices = {0: '/device:GPU:0', 1: '/device:GPU:1', 2: '/device:GPU:2'} gpu_devices = {0: '/device:GPU:0', 1: '/device:GPU:1', 2: '/device:GPU:2'}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment