forked from NVIDIA/DIGITS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ethantang95/Tim-Work
Basic Tensorflow Support
- Loading branch information
Showing
75 changed files
with
16,080 additions
and
180 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Temporary files | ||
*.swp | ||
*~ | ||
.DS_Store | ||
TAGS | ||
|
||
# Compiled / optimized files | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--max_line_length=120 | ||
--exclude_directories=3rdparty | ||
--exclude_directories=3rdparty,tb | ||
--disable=0121,0220 |
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
from __future__ import absolute_import | ||
|
||
import os | ||
import platform | ||
from subprocess import Popen,PIPE | ||
|
||
from . import option_list | ||
|
||
VARNAME_ENV_TFPY = 'TENSORFLOW_PYTHON' | ||
DEFAULT_PYTHON_EXE = 'python2' # @TODO(tzaman) - use the python executable that was used to launch digits? | ||
|
||
if platform.system() == 'Darwin': | ||
# DYLD_LIBRARY_PATH and LD_LIBRARY_PATH is sometimes stripped, and the cuda libraries might need it | ||
if not "DYLD_LIBRARY_PATH" in os.environ: | ||
if "CUDA_HOME" in os.environ: | ||
os.environ["DYLD_LIBRARY_PATH"] = str(os.environ["CUDA_HOME"] + '/lib') | ||
|
||
def test_tf_import(python_exe): | ||
""" | ||
Tests if tensorflow can be imported, returns if it went okay and optional error. | ||
""" | ||
p = Popen([python_exe, "-c", "import tensorflow"], stdout=PIPE, stderr=PIPE) | ||
(out, err) = p.communicate() | ||
return p.returncode==0, str(err) | ||
|
||
if VARNAME_ENV_TFPY in os.environ: | ||
tf_python_exe = os.environ[VARNAME_ENV_TFPY] | ||
else: | ||
tf_python_exe = DEFAULT_PYTHON_EXE | ||
|
||
tf_enabled, err = test_tf_import(tf_python_exe) | ||
|
||
if not tf_enabled: | ||
print('Tensorflow support disabled.') | ||
# print('Failed importing Tensorflow with python executable "%s"\n%s' % (tf_python_exe, err)) | ||
|
||
if tf_enabled: | ||
option_list['tensorflow'] = { | ||
'enabled': True, | ||
'executable': tf_python_exe, | ||
} | ||
else: | ||
option_list['tensorflow'] = { | ||
'enabled': False, | ||
} |
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
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
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
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
Oops, something went wrong.