Tensorflow install doesn't work

Tried to install the official pip wheel on the official JetPack 4.5 and it doesn’t work. Could we please ask NVIDIA to make sure that the official stuff on the website “just works” without needing to ask here in the forums? It’s extremely frustrating when even the official configuration on a fresh system spits out errors, and makes it extremely hard to create automated install scripts that just download and install everything non-interactively. Could you please use some kind of build verification system that test drives the install and makes sure it returns no errors before posting things to do the Downloads page? Thanks!

Model: Xavier NX
JetPack image from OFFICAL website: jetson-nx-jp45-sd-card-image.img
Tensorflow wheel from OFFICAL website: tensorflow-2.3.1+nv20.12-cp36-cp36m-linux_aarch64.whl
Fresh OS install, let it do all its OS updates it prompted me to do, sudo apt-get install python3-pip (successful), and then:

$ sudo pip3 install tensorflow-2.3.1+nv20.12-cp36-cp36m-linux_aarch64.whl 
The directory '/home/user/.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/user/.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.
Processing ./tensorflow-2.3.1+nv20.12-cp36-cp36m-linux_aarch64.whl
Collecting h5py<2.11.0,>=2.10.0 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/5f/97/a58afbcf40e8abecededd9512978b4e4915374e5b80049af082f49cebe9a/h5py-2.10.0.tar.gz (301kB)
    100% |████████████████████████████████| 307kB 1.7MB/s 
Collecting absl-py<0.11.0,>=0.7.0 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/b9/07/f69dd3367368ad69f174bfe426a973651412ec11d48ec05c000f19fe0561/absl_py-0.10.0-py3-none-any.whl (127kB)
    100% |████████████████████████████████| 133kB 3.6MB/s 
Collecting gast==0.3.3 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/d6/84/759f5dd23fec8ba71952d97bcc7e2c9d7d63bdc582421f3cd4be845f0c98/gast-0.3.3-py2.py3-none-any.whl
Collecting google-pasta>=0.1.8 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 4.7MB/s 
Collecting numpy<1.19.0,>=1.16.0 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/01/1b/d3ddcabd5817be02df0e6ee20d64f77ff6d0d97f83b77f65e98c8a651981/numpy-1.18.5.zip (5.4MB)
    100% |████████████████████████████████| 5.4MB 140kB/s 
Collecting wrapt>=1.11.1 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz
Requirement already satisfied: wheel>=0.26 in /usr/lib/python3/dist-packages (from tensorflow==2.3.1+nv20.12)
Collecting six>=1.12.0 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting grpcio>=1.8.6 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/20/4b/0b810309628e354f53b3c90af063f268d74e49902a41196db27f1fb52f06/grpcio-1.35.0.tar.gz (21.2MB)
    100% |████████████████████████████████| 21.2MB 40kB/s 
Collecting astunparse==1.6.3 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/2b/03/13dde6512ad7b4557eb792fbcf0c653af6076b81e5941d36ec61f7ce6028/astunparse-1.6.3-py2.py3-none-any.whl
Collecting protobuf>=3.9.2 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/fb/85/d81b70500e2faec3490e6c69bccf3ed87a9129f483a004f2049c8a8c22ed/protobuf-3.15.1-py2.py3-none-any.whl (173kB)
    100% |████████████████████████████████| 174kB 3.6MB/s 
Collecting tensorboard<3,>=2.3.0 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/64/21/eebd23060763fedeefb78bc2b286e00fa1d8abda6f70efa2ee08c28af0d4/tensorboard-2.4.1-py3-none-any.whl (10.6MB)
    100% |████████████████████████████████| 10.6MB 78kB/s 
Collecting opt-einsum>=2.3.2 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65kB)
    100% |████████████████████████████████| 71kB 5.2MB/s 
Collecting tensorflow-estimator<2.4.0,>=2.3.0 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/e9/ed/5853ec0ae380cba4588eab1524e18ece1583b65f7ae0e97321f5ff9dfd60/tensorflow_estimator-2.3.0-py2.py3-none-any.whl (459kB)
    100% |████████████████████████████████| 460kB 1.7MB/s 
Collecting keras-preprocessing<1.2,>=1.1.1 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/79/4c/7c3275a01e12ef9368a892926ab932b33bb13d55794881e3573482b378a7/Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42kB)
    100% |████████████████████████████████| 51kB 5.0MB/s 
Collecting termcolor>=1.1.0 (from tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Collecting google-auth-oauthlib<0.5,>=0.4.1 (from tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/81/67/e2c34bb0628984c7ce71cce6ba6964cb29c418873847fc285f826e032e6e/google_auth_oauthlib-0.4.2-py2.py3-none-any.whl
Collecting setuptools>=41.0.0 (from tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/15/0e/255e3d57965f318973e417d5b7034223f1223de500d91b945ddfaef42a37/setuptools-53.0.0-py3-none-any.whl (784kB)
    100% |████████████████████████████████| 788kB 954kB/s 
Collecting werkzeug>=0.11.15 (from tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/cc/94/5f7079a0e00bd6863ef8f1da638721e9da21e5bacee597595b318f71d62e/Werkzeug-1.0.1-py2.py3-none-any.whl (298kB)
    100% |████████████████████████████████| 307kB 2.5MB/s 
Collecting google-auth<2,>=1.6.3 (from tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/bf/6b/a364a4ad2a9d25904a19f53b9474ae9666b96e0653a6ca38492baf1bcf05/google_auth-1.27.0-py2.py3-none-any.whl (135kB)
    100% |████████████████████████████████| 143kB 4.7MB/s 
Collecting markdown>=2.6.8 (from tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/ac/ef/24a91ca96efa0d7802dffb83ccc7a3c677027bea19ec3c9ee80be740408e/Markdown-3.3.3-py3-none-any.whl (96kB)
    100% |████████████████████████████████| 102kB 6.1MB/s 
Collecting requests<3,>=2.21.0 (from tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl (61kB)
    100% |████████████████████████████████| 61kB 5.3MB/s 
Collecting tensorboard-plugin-wit>=1.6.0 (from tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/1a/c1/499e600ba0c618b451cd9c425ae1c177249940a2086316552fee7d86c954/tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781kB)
    100% |████████████████████████████████| 788kB 1.0MB/s 
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl
Collecting cachetools<5.0,>=2.0.0 (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/bb/72/8df2e0dc991f1a1d2c6869404e7622e8ee50d80bff357dbb57c3df70305b/cachetools-4.2.1-py3-none-any.whl
Collecting rsa<5,>=3.1.4; python_version >= "3.6" (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/a0/c6/f6f92e055213860a39c98e51a10a51af473bc799a889fe8edac11108245b/rsa-4.7.1-py3-none-any.whl
Collecting pyasn1-modules>=0.2.1 (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl (155kB)
    100% |████████████████████████████████| 163kB 4.1MB/s 
Collecting importlib-metadata; python_version < "3.8" (from markdown>=2.6.8->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/f3/ed/da40116a204abb5c4dd1d929346d33e0d29cedb2cedd18ea98f0385dcd92/importlib_metadata-3.4.0-py3-none-any.whl
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/lib/python3/dist-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
Requirement already satisfied: idna<3,>=2.5 in /usr/lib/python3/dist-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147kB)
    100% |████████████████████████████████| 153kB 4.4MB/s 
Collecting pyasn1>=0.1.3 (from rsa<5,>=3.1.4; python_version >= "3.6"->google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl (77kB)
    100% |████████████████████████████████| 81kB 3.9MB/s 
Collecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/41/ad/6a4f1a124b325618a7fb758b885b68ff7b058eec47d9220a12ab38d90b1f/zipp-3.4.0-py3-none-any.whl
Collecting typing-extensions>=3.6.4; python_version < "3.8" (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard<3,>=2.3.0->tensorflow==2.3.1+nv20.12)
  Downloading https://files.pythonhosted.org/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl
Installing collected packages: numpy, six, h5py, absl-py, gast, google-pasta, wrapt, grpcio, astunparse, protobuf, requests, oauthlib, requests-oauthlib, setuptools, cachetools, pyasn1, rsa, pyasn1-modules, google-auth, google-auth-oauthlib, werkzeug, zipp, typing-extensions, importlib-metadata, markdown, tensorboard-plugin-wit, tensorboard, opt-einsum, tensorflow-estimator, keras-preprocessing, termcolor, tensorflow
  Found existing installation: numpy 1.13.3
    Not uninstalling numpy at /usr/lib/python3/dist-packages, outside environment /usr
  Running setup.py install for numpy ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_eimsft2/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-2mlomye5-record/install-record.txt --single-version-externally-managed --compile:
    Running from numpy source directory.
    
    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:
    
      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install numpy`   (last NumPy release on PyPi)
    
    
    Cythonizing sources
    Processing numpy/random/_bounded_integers.pxd.in
    Processing numpy/random/_mt19937.pyx
    Traceback (most recent call last):
      File "/tmp/pip-build-_eimsft2/numpy/tools/cythonize.py", line 61, in process_pyx
        from Cython.Compiler.Version import version as cython_version
    ModuleNotFoundError: No module named 'Cython'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-build-_eimsft2/numpy/tools/cythonize.py", line 238, in <module>
        main()
      File "/tmp/pip-build-_eimsft2/numpy/tools/cythonize.py", line 234, in main
        find_process_files(root_dir)
      File "/tmp/pip-build-_eimsft2/numpy/tools/cythonize.py", line 225, in find_process_files
        process(root_dir, fromfile, tofile, function, hash_db)
      File "/tmp/pip-build-_eimsft2/numpy/tools/cythonize.py", line 191, in process
        processor_function(fromfile, tofile)
      File "/tmp/pip-build-_eimsft2/numpy/tools/cythonize.py", line 66, in process_pyx
        raise OSError('Cython needs to be installed in Python as a module')
    OSError: Cython needs to be installed in Python as a module
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-_eimsft2/numpy/setup.py", line 488, in <module>
        setup_package()
      File "/tmp/pip-build-_eimsft2/numpy/setup.py", line 469, in setup_package
        generate_cython()
      File "/tmp/pip-build-_eimsft2/numpy/setup.py", line 275, in generate_cython
        raise RuntimeError("Running cythonize failed!")
    RuntimeError: Running cythonize failed!
    
    ----------------------------------------
  Can't rollback numpy, nothing uninstalled.
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_eimsft2/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-2mlomye5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_eimsft2/numpy/

Hi,

The error is caused by a missing library.
The prerequisites for TensorFlow can be found in the below document:

Do you follow the steps and still meet the error?
If not, would you mind to try the instructions and share the result with us?

Thanks.

That worked, thanks!

FYI I was downloading it from

and I looked for instructions in “More Information”
and the only page it pointed to was this https://docs.nvidia.com/deeplearning/frameworks/tensorflow-user-guide/index.html
and I didn’t happen across the install instructions page you linked.

It might be helpful to include the prereqs right on the download page i.e. inside the drop-down grey box when you hit “Tensorflow for Jetpack” or maybe even consider including all the prereqs for TensorFlow and Pytorch with JetPack. But thanks!

Hi,

It’s seems that document is missing in the latest JetPack release.
Thanks for the feedback. I will check this with our internal team.