Cannot import TF 2.6.0 correctly on Xavier NX

hi trying to install tensor 2.6.0 with

pip3 install --pre --extra-index-url Index of /compute/redist/jp/v46 tensorflow==2.6.0+nv21.11

but getting the following error:

Using cached h5py-3.1.0.tar.gz (371 kB)
Installing build dependencies … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-k_tjewda/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i Simple index --extra-index-url Index of /compute/redist/jp/v46 --pre – setuptools wheel
cwd: None
Complete output (31 lines):
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.6/dist-packages/pip/main.py”, line 29, in
from pip._internal.cli.main import main as _main
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/main.py”, line 9, in
from pip._internal.cli.autocompletion import autocomplete
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/autocompletion.py”, line 10, in
from pip._internal.cli.main_parser import create_main_parser
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/main_parser.py”, line 8, in
from pip._internal.cli import cmdoptions
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/cmdoptions.py”, line 23, in
from pip._internal.cli.parser import ConfigOptionParser
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/parser.py”, line 12, in
from pip._internal.configuration import Configuration, ConfigurationError
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/configuration.py”, line 26, in
from pip._internal.utils.logging import getLogger
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/utils/logging.py”, line 13, in
from pip._internal.utils.misc import ensure_dir
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/utils/misc.py”, line 36, in
from pip._vendor.tenacity import retry, stop_after_delay, wait_fixed
File “/usr/local/lib/python3.6/dist-packages/pip/_vendor/tenacity/init.py”, line 26, in
from concurrent import futures
File “/usr/local/lib/python3.6/dist-packages/concurrent/futures/init.py”, line 8, in
from concurrent.futures._base import (FIRST_COMPLETED,
File “/usr/local/lib/python3.6/dist-packages/concurrent/futures/_base.py”, line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
WARNING: Discarding https://files.pythonhosted.org/packages/a7/81/20d5d994c91ed8347efda90d32c396ea28254fd8eb9e071e28ee5700ffd5/h5py-3.1.0.tar.gz#sha256=1e2516f190652beedcb8c7acfa1c6fa92d99b42331cbef5e5c7ec2d65b0fc3c2 (from Links for h5py) (requires-python:>=3.6). Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-k_tjewda/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i Simple index --extra-index-url Index of /compute/redist/jp/v46 --pre – setuptools wheel Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement h5py~=3.1.0 (from tensorflow) (from versions: 2.2.1, 2.3.0b1, 2.3.0, 2.3.1, 2.4.0b1, 2.4.0, 2.5.0, 2.6.0, 2.7.0rc2, 2.7.0, 2.7.1, 2.8.0rc1, 2.8.0, 2.9.0rc1, 2.9.0, 2.10.0, 3.0.0rc1, 3.0.0, 3.1.0)
ERROR: No matching distribution found for h5py~=3.1.0

Hi,

Would you mind trying it on a clean JetPack 4.6 environment?
We have verified the instructions that both h5py and TensorFlow can work correctly.

Thanks.

Works for me

Sorry does not work for me still get issues with h5py installation upon 4.6 rev. 3
I was able to activate the tensorflow with docker (but I don’t think that this was NVidia’s original update to Rev. 3 intension)
Regards.

@AastaLLL

for me installation is working:

>>> tf.random.normal((5,))
2021-12-03 07:27:14.191646: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:14.778247: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:14.778634: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:14.782590: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:14.782916: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:14.783222: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:20.401586: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:20.402007: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:20.402271: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1017] ARM64 does not support NUMA - returning NUMA node zero
2021-12-03 07:27:20.402537: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1510] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3426 MB memory:  -> device: 0, name: Xavier, pci bus id: 0000:00:00.0, compute capability: 7.2
<tf.Tensor: shape=(5,), dtype=float32, numpy=
array([-0.531246  , -1.1444426 ,  0.44512638, -0.12118675,  0.15413287],
      dtype=float32)>
>>> 

@AastaLLL

Now, Keras is not working…

ubuntu@NVIDIA-01:~/Desktop/Projects/rl-toolkit$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.keras import Model
2021-12-03 07:21:20.298029: E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/api/keras/optimizers
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/keras/api/_v2/keras/__init__.py", line 10, in <module>
    from keras import __version__
  File "/usr/local/lib/python3.6/dist-packages/keras/__init__.py", line 25, in <module>
    from keras import models
  File "/usr/local/lib/python3.6/dist-packages/keras/models.py", line 20, in <module>
    from keras import metrics as metrics_module
  File "/usr/local/lib/python3.6/dist-packages/keras/metrics.py", line 26, in <module>
    from keras import activations
  File "/usr/local/lib/python3.6/dist-packages/keras/activations.py", line 20, in <module>
    from keras.layers import advanced_activations
  File "/usr/local/lib/python3.6/dist-packages/keras/layers/__init__.py", line 23, in <module>
    from keras.engine.input_layer import Input
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/input_layer.py", line 21, in <module>
    from keras.engine import base_layer
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py", line 43, in <module>
    from keras.mixed_precision import loss_scale_optimizer
  File "/usr/local/lib/python3.6/dist-packages/keras/mixed_precision/loss_scale_optimizer.py", line 18, in <module>
    from keras import optimizers
  File "/usr/local/lib/python3.6/dist-packages/keras/optimizers.py", line 26, in <module>
    from keras.optimizer_v2 import adadelta as adadelta_v2
  File "/usr/local/lib/python3.6/dist-packages/keras/optimizer_v2/adadelta.py", line 22, in <module>
    from keras.optimizer_v2 import optimizer_v2
  File "/usr/local/lib/python3.6/dist-packages/keras/optimizer_v2/optimizer_v2.py", line 37, in <module>
    "/tensorflow/api/keras/optimizers", "keras optimizer usage", "method")
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/monitoring.py", line 361, in __init__
    len(labels), name, description, *labels)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/monitoring.py", line 135, in __init__
    self._metric = self._metric_methods[self._label_length].create(*args)
tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.
>>>

With reinstalling Keras to 2.6.0 all is working:
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v46 'keras~=2.6.0'

Thanks.

Hi @AastaLLL ,

To finalize this topic, could you describe to steps for installation for Xavier AGX with links?

Is Installing TensorFlow for Jetson Platform :: NVIDIA Deep Learning Frameworks Documentation
link still applicable for installation or did your team suggest new instructions?

Kind regards,

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.