Official TensorFlow for Jetson Nano!

seems installed fine

Successfully built gast numpy absl-py termcolor grpcio h5py
Installing collected packages: protobuf, numpy, markdown, grpcio, absl-py, werkzeug, tensorboard, h5py, keras-applications, gast, keras-preprocessing, astor, termcolor, pbr, mock, tensorflow-estimator, tensorflow-gpu
Successfully installed absl-py-0.7.1 astor-0.7.1 gast-0.2.2 grpcio-1.19.0 h5py-2.9.0 keras-applications-1.0.7 keras-preprocessing-1.0.9 markdown-3.1 mock-2.0.0 numpy-1.16.2 pbr-5.1.3 protobuf-3.7.1 tensorboard-1.13.1 tensorflow-estimator-1.13.0 tensorflow-gpu-1.13.1+nv19.3 termcolor-1.1.0 werkzeug-0.15.2

root@sundar-desktop:/home/sundar# pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.13.1+nv19.3 --user
Traceback (most recent call last):
File “/usr/bin/pip3”, line 9, in
from pip import main
ImportError: cannot import name ‘main’

what can I do for this?

Exception:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/lib/python3/dist-packages/pip/commands/install.py”, line 353, in run
wb.build(autobuilding=True)
File “/usr/lib/python3/dist-packages/pip/wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “/usr/lib/python3/dist-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/usr/lib/python3/dist-packages/pip/req/req_set.py”, line 620, in _prepare_file
session=self.session, hashes=hashes)
File “/usr/lib/python3/dist-packages/pip/download.py”, line 821, in unpack_url
hashes=hashes
File “/usr/lib/python3/dist-packages/pip/download.py”, line 663, in unpack_http_url
unpack_file(from_path, location, content_type, link)
File “/usr/lib/python3/dist-packages/pip/utils/init.py”, line 617, in unpack_file
flatten=not filename.endswith(‘.whl’)
File “/usr/lib/python3/dist-packages/pip/utils/init.py”, line 506, in unzip_file
data = zip.read(name)
File “/usr/lib/python3.6/zipfile.py”, line 1338, in read
return fp.read()
File “/usr/lib/python3.6/zipfile.py”, line 858, in read
buf += self._read1(self.MAX_N)
File “/usr/lib/python3.6/zipfile.py”, line 948, in _read1
data = self._decompressor.decompress(data, n)
MemoryError
also this ?

Hi,

This is a known issue for pip on Ubuntu18.04.
Please check this comment for the solution:
https://devtalk.nvidia.com/default/topic/1049922/jetson-agx-xavier/installing-python-packages-with-pip/post/5328614/#5328614

Thanks.

Hi, krisha.sundar19

The second one looks like is an OOM issue.

You can confirm this with the tegrastats first.

sudo tegrastats

Maybe add some swap can make the compiling/installation works.
https://www.jetsonhacks.com/2019/04/14/jetson-nano-use-more-memory/

Thanks.

@krisha.sundar19: as mentioned by @AastaLLL, you’re out of memory. Close web browser or install more swap. I have to check that out as well. 8 GB should be standard, I am happy to pay $10 more instead of software hacks.

Thank you @AastaLL and @ludwigschreier I uninstalled and reinstalled my pip3 and everything worked out

Hi

I followed the official install :
sudo apt-get install python3-pip libhdf5-serial-dev hdf5-tools
pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.13.1+nv19.4 --user

And I’ve got a memory error :

sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.13.1+nv19.4 --user
The directory '/home/gilles/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/gilles/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow-gpu==1.13.1+nv19.4
  Downloading https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/tensorflow_gpu-1.13.1+nv19.4-cp36-cp36m-linux_aarch64.whl (204.6MB)
    99% |████████████████████████████████| 204.6MB 2.2MB/s eta 0:00:01Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 342, in run
    requirement_set.prepare_files(finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/usr/lib/python3/dist-packages/pip/download.py", line 659, in unpack_http_url
    hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 882, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 605, in _download_url
    consume(downloaded_chunks)
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 870, in consume
    deque(iterator, maxlen=0)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 571, in written_chunks
    for chunk in chunks:
  File "/usr/lib/python3/dist-packages/pip/utils/ui.py", line 139, in iter
    for x in it:
  File "/usr/lib/python3/dist-packages/pip/download.py", line 560, in resp_read
    decode_content=False):
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/response.py", line 436, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/response.py", line 384, in read
    data = self._fp.read(amt)
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/filewrapper.py", line 63, in read
    self._close()
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/filewrapper.py", line 50, in _close
    self.__callback(self.__buf.getvalue())
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/controller.py", line 275, in cache_response
    self.serializer.dumps(request, response, body=body),
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 55, in dumps
    "body": _b64_encode_bytes(body),
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 12, in _b64_encode_bytes
    return base64.b64encode(b).decode("ascii")
MemoryError

Any idea ?
Regards

Hi,

It looks like you are running out of the storage.
Could you check it first?

df -h

Thanks.

Hi,

You are perfectly right : too much processes in the same time => memory shortage !
I shuted down and re-strated the session, and the install ran perfectly fine.
Thanks for your help

Regards

Hi, expert

I have successfully installed TensorFlow for Jetson Nano.

hgnan@jetson-nano:~$ sudo apt-get install python3-pip libhdf5-serial-dev hdf5-tools
.....
hgnan@jetson-nano:~$ pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.13.1+nv19.4 --user
.....

Verifying The Installation:

hgnan@jetson-nano:~/shell$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>>

But I have issue , When I install ISR (https://github.com/idealo/image-super-resolutio) from PyPI

hgnan@jetson-nano:~$ pip3 install ISR
Collecting ISR
  Downloading https://files.pythonhosted.org/packages/46/b3/8ff67a4f7987beab0d24d9293021d6c7d2682d74430fe0444d28232635ad/ISR-2.0.2-py3-none-any.whl
Collecting imageio (from ISR)
  Downloading https://files.pythonhosted.org/packages/af/0a/943c965d372dae0b1f1482677d29030ab834351a61a9a632fd62f27f1523/imageio-2.5.0-py3-none-any.whl (3.3MB)
    100% |████████████████████████████████| 3.3MB 14kB/s
Collecting tensorflow==1.13.1 (from ISR)
[b]  Could not find a version that satisfies the requirement tensorflow==1.13.1 (from ISR) (from versions: )
No matching distribution found for tensorflow==1.13.1 (from ISR)[/b]

How should I solve the problem?
Thank you.

Hi, Walter_LIU

It looks like you already file a new topic for your question:
[url]https://devtalk.nvidia.com/default/topic/1050920/jetson-nano/could-not-find-a-version-that-satisfies-the-requirement-tensorflow/[/url]

Let’s track the following status on that topic.
Thanks.

I am installing tensorflow-gpu==1.13.1+nv19.4 on my Jetson Nano (via the pip command mentioned at the beginning). I intend to use Nano for inference on a robot .

For training I have a desktop machine with an Nvidia GPU. To use the same version of tensor flow for training is it enough that I install via pip install tensorflow-gpu==1.11 on the desktop machine ? or should I worry about nv19.4 too ?

it works. The benchmark([url]https://github.com/tensorflow/benchmarks[/url]) is good too.

python scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py --data_format=NHWC --device=gpu
2019-05-04 10:26:03.502722: W tensorflow/core/platform/profile_utils/cpu_utils.cc:98] Failed to find bogomips in /proc/cpuinfo; cannot determine CPU frequency
2019-05-04 10:26:03.503420: I tensorflow/compiler/xla/service/service.cc:161] XLA service 0x409c68b0 executing computations on platform Host. Devices:
2019-05-04 10:26:03.503489: I tensorflow/compiler/xla/service/service.cc:168] StreamExecutor device (0): ,
2019-05-04 10:26:03.576170: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:965] ARM64 does not support NUMA - returning NUMA node zero
2019-05-04 10:26:03.576470: I tensorflow/compiler/xla/service/service.cc:161] XLA service 0x404a1210 executing computations on platform CUDA. Devices:
2019-05-04 10:26:03.576536: I tensorflow/compiler/xla/service/service.cc:168] StreamExecutor device (0): NVIDIA Tegra X1, Compute Capability 5.3
2019-05-04 10:26:03.576872: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties:
name: NVIDIA Tegra X1 major: 5 minor: 3 memoryClockRate(GHz): 0.9216
pciBusID: 0000:00:00.0
totalMemory: 3.86GiB freeMemory: 356.95MiB
2019-05-04 10:26:03.576939: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-05-04 10:26:04.741833: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-05-04 10:26:04.741924: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2019-05-04 10:26:04.741961: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2019-05-04 10:26:04.742174: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 113 MB memory) → physical GPU (device: 0, name: NVIDIA Tegra X1, pci bus id: 0000:00:00.0, compute capability: 5.3)
TensorFlow: 1.13
Model: trivial
Dataset: imagenet (synthetic)
Mode: training
SingleSess: False
Batch size: 32 global
32 per device
Num batches: 100
Num epochs: 0.00
Devices: [‘/gpu:0’]
NUMA bind: False
Data format: NHWC
Optimizer: sgd
Variables: parameter_server

Generating training model
W0504 10:26:04.763707 547975663632 deprecation.py:323] From /home/vertex/gitpool/benchmarks/venv2/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
W0504 10:26:05.094968 547975663632 deprecation.py:323] From /home/vertex/gitpool/benchmarks/venv2/lib/python3.6/site-packages/tensorflow/python/ops/losses/losses_impl.py:209: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
Initializing graph
W0504 10:26:05.884903 547975663632 deprecation.py:323] From /home/vertex/gitpool/benchmarks/scripts/tf_cnn_benchmarks/benchmark_cnn.py:2238: Supervisor.init (from tensorflow.python.training.supervisor) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.MonitoredTrainingSession
2019-05-04 10:26:06.422346: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-05-04 10:26:06.422466: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-05-04 10:26:06.422510: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2019-05-04 10:26:06.422542: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2019-05-04 10:26:06.422662: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 113 MB memory) → physical GPU (device: 0, name: NVIDIA Tegra X1, pci bus id: 0000:00:00.0, compute capability: 5.3)
I0504 10:26:06.585908 547975663632 session_manager.py:491] Running local_init_op.
I0504 10:26:06.645804 547975663632 session_manager.py:493] Done running local_init_op.
Running warm up
2019-05-04 10:26:06.865597: I tensorflow/stream_executor/dso_loader.cc:153] successfully opened CUDA library libcublas.so.10.0 locally
Done warm up
Step Img/sec total_loss
1 images/sec: 995.0 +/- 0.0 (jitter = 0.0) 7.051
10 images/sec: 1095.3 +/- 18.0 (jitter = 37.9) 7.051
20 images/sec: 1079.8 +/- 11.6 (jitter = 67.1) 7.051
30 images/sec: 1077.3 +/- 8.3 (jitter = 51.7) 7.051
40 images/sec: 1080.8 +/- 6.5 (jitter = 38.7) 7.051
50 images/sec: 1082.6 +/- 5.8 (jitter = 37.0) 7.051
60 images/sec: 1084.5 +/- 5.2 (jitter = 36.8) 7.051
70 images/sec: 1085.6 +/- 4.6 (jitter = 34.3) 7.051
80 images/sec: 1094.3 +/- 5.0 (jitter = 41.2) 7.051
90 images/sec: 1092.9 +/- 4.6 (jitter = 37.5) 7.051
100 images/sec: 1093.0 +/- 4.3 (jitter = 36.7) 7.051

total images/sec: 1077.59

Dear Support Team,
I have a problem:
I just installed the latest tensorflow-gpu for a jetson nano, and I tried to run an example, which give me the error:
File “/home/jetson/image_processing/flownet2-tf-master/src/correlation.py”, line 4, in
tf.resource_loader.get_path_to_datafile(“./ops/build/correlation.so”))
File “/home/jetson/.local/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py”, line 61, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /home/jetson/image_processing/flownet2-tf-master/src/./ops/build/correlation.so: undefined symbol: _ZN10tensorflow12OpDefBuilder4AttrESs

This flownet2-tf model can be compiled and run on an other PC with nvidia gtx 1060, cuda 10, ubuntu 18.04, python3.6, etc.
However, on jetson I get the error above.

I found, that on the PC the libtensorflow_framework.so contains “_ZN10tensorflow12OpDefBuilder4AttrESs”, but on the jetson the same file does not contain this symbol.

What shoud be the reason of this error?

Sincerely, András Bánhalmi

Same problem with me on Xavir JP4.2 R32.1 with tensorflow_gpu-1.13.1+nv19.4-cp36-cp36m-linux_aarch64.whl
“undefined symbol: _ZN10tensorflow12OpDefBuilder4AttrESs” tensorflow .python.framework.errors_impl.NotFoundError

Hi,

I followed the advice above and installed tensorflow. When I tested, I got the following error:

Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow as tf
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “”, line 968, in _find_and_load
SystemError: <class ‘_frozen_importlib._ModuleLockManager’> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-05-17 16:51:06.181781: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr
Aborted (core dumped)

Any ideas? Thanks.

uninistall and re-install numpy solved this problem.

Sorry for interrupt.

Good to know it works now.