Install TensorFlow on PX2

Hi,

I have some problems to install tensorflow on PX2. When I followed the link “https://syed-ahmed.gitbooks.io/nvidia-jetson-tx2-recipes/content/first-question.html”, (change the “–local_resources” as “8192,2.0,1.0”), the system went very slowly and then the terminal crashed. Do you have some good idea to install tensorflow on PX2?

Thanks

Dear zhishengusa,

We had posted “DRIVE PX2 Deep Learning App Notes” on https://developer.nvidia.com/nvidia-drive-downloads.
Could you please refer to the link to install TF on DPX2? Thanks.

Hi,

When trying to install the CUDA package downloaded using this instructions we get the following:

sudo dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb
dpkg: error processing archive cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb (--install):
 cannot access archive: No such file or directory
Errors were encountered while processing:
 cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb

Can you please let us know here we can get the CUDA repo?

Thanks

Dear lgriera,

You mean you need to install CUDA 9.0 on DrivePX2?
If so, it is not possible to install CUDA 9.0 on DPX2. Thanks.

Dear Steve,

Now we have CUDA 9.0 install on the PX2. However, we have not been able to install TensorFlow now.

I have follow the instruction in: https://syed-ahmed.gitbooks.io/nvidia-jetson-tx2-recipes/content/first-question.html, and also fix the broken cudnn.h linking issue, but now I am getting the error below.

nvidia@nvidia:~/tensorflow$ bazel build -c opt --local_resources 3072,4.0,1.0 --verbose_failures --config=cuda //tensorflow/tools/pip_package:build_pip_package
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
INFO: Found 1 target...
INFO: From Compiling external/llvm/lib/DebugInfo/MSF/StreamReader.cpp:
external/llvm/lib/DebugInfo/MSF/StreamReader.cpp: In member function 'llvm::Error llvm::msf::StreamReader::readInteger(int8_t&)':
external/llvm/lib/DebugInfo/MSF/StreamReader.cpp:70:12: warning: 'P' may be used uninitialized in this function [-Wmaybe-uninitialized]
   Dest = *P;
            ^
external/llvm/lib/DebugInfo/MSF/StreamReader.cpp: In member function 'llvm::Error llvm::msf::StreamReader::readZeroString(llvm::StringRef&)':
external/llvm/lib/DebugInfo/MSF/StreamReader.cpp:106:12: warning: 'C' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (*C != '\0')
            ^
external/llvm/lib/DebugInfo/MSF/StreamReader.cpp: In member function 'llvm::Error llvm::msf::StreamReader::readInteger(uint8_t&)':
external/llvm/lib/DebugInfo/MSF/StreamReader.cpp:38:12: warning: 'P' may be used uninitialized in this function [-Wmaybe-uninitialized]
   Dest = *P;
            ^
INFO: From Compiling external/nccl_archive/src/all_reduce.cu.cc:
external/nccl_archive/src/common_kernel.h(237): error: class "__half" has no member "x"

external/nccl_archive/src/common_kernel.h(237): error: class "__half" has no member "x"

external/nccl_archive/src/common_kernel.h(250): error: class "__half" has no member "x"

external/nccl_archive/src/common_kernel.h(250): error: class "__half" has no member "x"

external/nccl_archive/src/copy_kernel.h(28): error: class "__half" has no member "x"

external/nccl_archive/src/copy_kernel.h(28): error: class "__half" has no member "x"

6 errors detected in the compilation of "/tmp/tmpxft_00007fa0_00000000-7_all_reduce.cu.compute_52.cpp1.ii".
ERROR: /home/nvidia/.cache/bazel/_bazel_nvidia/d2751a49dacf4cb14a513ec663770624/external/nccl_archive/BUILD.bazel:33:1: output 'external/nccl_archive/_objs/nccl/external/nccl_archive/src/all_reduce.cu.pic.o' was not created.
ERROR: /home/nvidia/.cache/bazel/_bazel_nvidia/d2751a49dacf4cb14a513ec663770624/external/nccl_archive/BUILD.bazel:33:1: not all outputs were created or valid.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 157.932s, Critical Path: 133.16s

Any help, will be greatly appreciated.

Dear lgriera,

Did you flash DriveInstall 5.0.5.0 Linux SDK? Because CUDA 9.0 for DPX2 is involved in DriveInstall 5.0.5.0 Linux SDK.
And please use “DRIVE PX2 Deep Learning App Notes” on https://developer.nvidia.com/nvidia-drive-downloads. Thanks.

Thanks Steve,

I was able to install Docker and Torch using the material in “DRIVE PX2 Deep Learning App Notes”. However, TensorFlow didn’t work. As soon as I invoke the import statement, I get:

import tensorflow as tf
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 61, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
  File "/usr/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 72, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 61, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
  File "/usr/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

As I am new to Docker, I don’t know if I have to install TensorFlow using a package manager such as ‘pip’ or ‘apt-get’.

Regards,
Luis

Doesn’t Trt3.0 provides the tensorflow as a native support?

Unfortunately, as I have been informed TensorRT 3.0 does not support TensorFlow for the PX2 yet. As I understand it does in X86 architecture.

I am also stuck up with the same issue as i think we need to run TRT on host and we need to use a UFF parser to convert the model and then deploy it in PX2, but the question is where can we find the docs to make sure the deployment is done successfully.

I have not been able to find much information nor we have access to the repositories to the previous system version. Once we update the system, we have not been able to flash the system back.

With the previous version, we were able to run TensorFlow using Docker. It was not what really like, but it ran. We have not had much time to work it. However, we have been told to use the Python code wrap in C.

Atlast i found the solution to this, we need to install the TRT3 on the host, import the model using the python wrapper and do all the optimization on the host using the UFF. Now when the INT8 cache plan is generated use the cross compilation method to send the data to device(PX2) and then we can perform an inference on it.

hi abishek,

"Now when the INT8 cache plan is generated use the cross compilation method to send the data to device(PX2) and then we can perform an inference on it. "

how could u perform this? what’s the cross complication method? do you have some sample code with this?