Gazenet sample notebook not working

I’m having issue running the gazenet notebook from the tlt_cv_samples

• Hardware: XavierNX
• TLT Version: 3

To install the pip requirements from the deps directory, I get the following result.

Looking in indexes: Simple index, https://pypi.ngc.nvidia.com
Collecting numpy==1.17.0
Downloading numpy-1.17.0.zip (6.5 MB)
|████████████████████████████████| 6.5 MB 4.5 MB/s eta 0:00:01
ERROR: Could not find a version that satisfies the requirement opencv-python==3.4.0.12 (from versions: 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.14.53, 3.4.15.55, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.2.54, 4.5.3.56)
ERROR: No matching distribution found for opencv-python==3.4.0.12
WARNING: You are using pip version 21.1.3; however, version 21.2.1 is available.
You should consider upgrading via the ‘/home/brad/Envs/launcher/bin/python -m pip install --upgrade pip’ command.

If I change it to 3.4.14.53, then it passes that but fails on matplotlib

Looking in indexes: Simple index, https://pypi.ngc.nvidia.com
Collecting numpy==1.17.0
Downloading numpy-1.17.0.zip (6.5 MB)
|████████████████████████████████| 6.5 MB 5.8 MB/s eta 0:00:01
Collecting opencv-python==3.4.15.55
Downloading opencv_python-3.4.15.55-cp36-cp36m-manylinux2014_aarch64.whl (32.5 MB)
|████████████████████████████████| 32.5 MB 34.1 MB/s eta 0:00:01�██████████████▍ | 18.7 MB 6.3 MB/s eta 0:00:03
Collecting pillow==8.1.0
Downloading Pillow-8.1.0-cp36-cp36m-manylinux2014_aarch64.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 12.6 MB/s eta 0:00:01 |███▉ | 256 kB 12.6 MB/s eta 0:00:01
Collecting matplotlib==3.1.1
Downloading matplotlib-3.1.1.tar.gz (37.8 MB)
|████████████████████████████████| 37.8 MB 35.1 MB/s eta 0:00:01 |███▋ | 4.2 MB 17.9 MB/s eta 0:00:02
ERROR: Command errored out with exit status -4:
command: /home/brad/Envs/launcher/bin/python -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-htk4skxi/matplotlib_1f3c31ec8ea2482e8ea00c0ade18fe7e/setup.py’"’"’; file=’"’"’/tmp/pip-install-htk4skxi/matplotlib_1f3c31ec8ea2482e8ea00c0ade18fe7e/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base /tmp/pip-pip-egg-info-07d_tetg
cwd: /tmp/pip-install-htk4skxi/matplotlib_1f3c31ec8ea2482e8ea00c0ade18fe7e/
Complete output (28 lines):
================================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
  matplotlib: yes [3.1.1]
      python: yes [3.6.9 (default, Jan 26 2021, 15:33:00)  [GCC 8.4.0]]
    platform: yes [linux]

OPTIONAL SUBPACKAGES
 sample_data: yes [installing]
       tests: no  [skipping due to configuration]

OPTIONAL BACKEND EXTENSIONS
         agg: yes [installing]
       tkagg: yes [installing; run-time loading from Python Tcl/Tk]
      macosx: no  [Mac OS-X only]

OPTIONAL PACKAGE DATA
        dlls: no  [skipping due to configuration]

running egg_info
creating /tmp/pip-pip-egg-info-07d_tetg/matplotlib.egg-info
writing /tmp/pip-pip-egg-info-07d_tetg/matplotlib.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-07d_tetg/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to /tmp/pip-pip-egg-info-07d_tetg/matplotlib.egg-info/namespace_packages.txt
writing requirements to /tmp/pip-pip-egg-info-07d_tetg/matplotlib.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-07d_tetg/matplotlib.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-07d_tetg/matplotlib.egg-info/SOURCES.txt'
----------------------------------------

WARNING: Discarding https://files.pythonhosted.org/packages/12/d1/7b12cd79c791348cb0c78ce6e7d16bd72992f13c9f1e8e43d2725a6d8adf/matplotlib-3.1.1.tar.gz#sha256=1febd22afe1489b13c6749ea059d392c03261b2950d1d45c17e3aed812080c93 (from Links for matplotlib) (requires-python:>=3.6). Command errored out with exit status -4: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement matplotlib==3.1.1 (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 3.0.0rc2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0rc1, 3.1.0rc2, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0rc1, 3.2.0rc3, 3.2.0, 3.2.1, 3.2.2, 3.3.0rc1, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4)
ERROR: No matching distribution found for matplotlib==3.1.1

I am running in a 3.6.9 virtualenv

Please run training in host PC instead of Jetson device.
After training done, you can run inference in host PC or Jetson device.

Hi @Morganh,

Still the same dependency issue applies. Running on Ubuntu 18.04 / Python 3.8

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: Simple index, https://pypi.ngc.nvidia.com
Collecting numpy==1.17.0
Downloading numpy-1.17.0.zip (6.5 MB)
|████████████████████████████████| 6.5 MB 3.9 MB/s eta 0:00:01
ERROR: Could not find a version that satisfies the requirement opencv-python==3.4.0.12 (from versions: 3.4.8.29, 3.4.9.31, 3.4.9.33, 3.4.10.35, 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.14.53, 3.4.15.55, 4.1.2.30, 4.2.0.32, 4.2.0.34, 4.3.0.36, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.2.54, 4.5.3.56)
ERROR: No matching distribution found for opencv-python==3.4.0.12

If I change the version then everything else breaks:

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: Simple index, https://pypi.ngc.nvidia.com
Collecting numpy==1.17.0
Downloading numpy-1.17.0.zip (6.5 MB)
|████████████████████████████████| 6.5 MB 4.2 MB/s eta 0:00:01
Collecting opencv-python==3.4.8.29
Downloading opencv_python-3.4.8.29-cp38-cp38-manylinux1_x86_64.whl (28.3 MB)
|████████████████████████████████| 28.3 MB 29.0 MB/s eta 0:00:01
Collecting pillow==8.1.0
Downloading Pillow-8.1.0-cp38-cp38-manylinux1_x86_64.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 32.7 MB/s eta 0:00:01
Collecting matplotlib==3.1.1
Downloading matplotlib-3.1.1.tar.gz (37.8 MB)
|████████████████████████████████| 37.8 MB 26.6 MB/s eta 0:00:01
Collecting scipy==1.5.4
Downloading scipy-1.5.4-cp38-cp38-manylinux1_x86_64.whl (25.8 MB)
|████████████████████████████████| 25.8 MB 18.3 MB/s eta 0:00:01
Collecting h5py==3.1.0
Downloading h5py-3.1.0-cp38-cp38-manylinux1_x86_64.whl (4.4 MB)
|████████████████████████████████| 4.4 MB 5.0 MB/s eta 0:00:01
Collecting joblib==1.0.1
Downloading joblib-1.0.1-py3-none-any.whl (303 kB)
|████████████████████████████████| 303 kB 31.3 MB/s eta 0:00:01
Collecting pycocotools==2.0.2
Downloading pycocotools-2.0.2.tar.gz (23 kB)
INFO: pip is looking at multiple versions of to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r /home/brad/deps/requirements-pip.txt (line 2) and numpy==1.17.0 because these package versions have conflicting dependencies.

The conflict is caused by:
The user requested numpy==1.17.0
opencv-python 3.4.8.29 depends on numpy>=1.17.3

To fix this you could try to:

  1. loosen the range of package versions you’ve specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

May I know what commands did you run?

@Morganh

I’ve just tried it again using the AWS AMI instructions to confirm it’s not a problem with my setup.

https://docs.nvidia.com/tlt/tlt-user-guide/text/running_in_cloud/running_tlt_on_aws.html

there are the exact commands since the AMI was launched (as instructed by the above link)

1 sudo apt update
2 sudo apt install python3-pip
3 sudo apt install unzip
4 pip3 install virtualenvwrapper
5 export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
6 export WORKON_HOME=/home/ubuntu/.virtualenvs
7 export PATH=/home/ubuntu/.local/bin:$PATH
8 source /home/ubuntu/.local/bin/virtualenvwrapper.sh
9 mkvirtualenv -p /usr/bin/python3 launcher
10 workon launcher
11 pip3 install jupyterlab
12 docker login nvcr.io
13 wget --content-disposition https://api.ngc.nvidia.com/v2/resources/nvidia/tlt_cv_samples/versions/v1.1.0/zip -O tlt_cv_samples_v1.1.0.zip
14 unzip -u tlt_cv_samples_v1.1.0.zip -d ./tlt_cv_samples_v1.1.0 && cd ./tlt_cv_samples_v1.1.0
15 jupyter notebook --ip 0.0.0.0 --port 8888 --allow-root

Then I run through the gazenet.ipynb notebook, and it fails at the same point again.

Install requirement

!pip3 install -r $SAMPLES_DIR/deps/requirements-pip.txt
Collecting numpy==1.17.0
Downloading numpy-1.17.0.zip (6.5 MB)
|████████████████████████████████| 6.5 MB 19.7 MB/s eta 0:00:01
ERROR: Could not find a version that satisfies the requirement opencv-python==3.4.0.12 (from versions: 3.4.8.29, 3.4.9.31, 3.4.9.33, 3.4.10.35, 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.14.53, 3.4.15.55, 4.1.2.30, 4.2.0.32, 4.2.0.34, 4.3.0.36, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.2.54, 4.5.3.56)
ERROR: No matching distribution found for opencv-python==3.4.0.12
WARNING: You are using pip version 21.1.3; however, version 21.2.1 is available.
You should consider upgrading via the ‘/home/ubuntu/.virtualenvs/launcher/bin/python -m pip install --upgrade pip’ command.

So it is still not working in a completely fresh AWS environment. Using the NVIDIA provided AMI

(AMI: aws-marketplace/NVIDIA Deep Learning AMI v21.06.0-46a68101-e56b-41cd-8e32-631ac6e5d02b)

OK, I will check further.

1 Like

$ cat deps/requirements-pip.txt
numpy==1.17.0
opencv-python==3.4.0.12
pillow==8.1.0
matplotlib==3.1.1
scipy==1.5.4
h5py==3.1.0
joblib==1.0.1
pycocotools==2.0.2

Can you try to run following command in your terminal instead of jupyter notebook?

$ pip3 install opencv-python==3.4.0.12

I did not meet issue when run above command.

My python version is
$ python --version
Python 3.6.12

Hey @Morganh,

It does not work in terminal

pip3 install opencv-python==3.4.0.12
ERROR: Could not find a version that satisfies the requirement opencv-python==3.4.0.12 (from versions: 3.4.8.29, 3.4.9.31, 3.4.9.33, 3.4.10.35, 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.14.53, 3.4.15.55, 4.1.2.30, 4.2.0.32, 4.2.0.34, 4.3.0.36, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.2.54, 4.5.3.56)
ERROR: No matching distribution found for opencv-python==3.4.0.12

It looks like the provided NVIDIA DeepLearning AMI comes with Python 3.8.10

python3 --version
Python 3.8.10

Ok, so I tried 3.7 and it didn’t work. However, this opencv package does install on 3.6.

However, the installing from the requirements.txt still fails.

Collecting numpy==1.17.0
Downloading numpy-1.17.0-cp36-cp36m-manylinux1_x86_64.whl (20.4 MB)
|████████████▍ | 7.9 MB 19.7 MB/s eta 0:00:01
|██████████████████████▉ | 14.5 MB 19.7 MB/s eta 0:00:01
|██████████████████████████████▍ | 19.3 MB 19.7 MB/s eta 0:00:01
|████████████████████████████████| 20.4 MB 19.7 MB/s eta 0:00:01
Requirement already satisfied: opencv-python==3.4.0.12 in /home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages (from -r /home/ubuntu/tlt_cv_samples_v1.1.0/deps/requirements-pip.txt (line 2)) (3.4.0.12)
Collecting pillow==8.1.0
Downloading Pillow-8.1.0-cp36-cp36m-manylinux1_x86_64.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 109.9 MB/s eta 0:00:01
Collecting matplotlib==3.1.1
Downloading matplotlib-3.1.1-cp36-cp36m-manylinux1_x86_64.whl (13.1 MB)
|████████████████████████████████| 13.1 MB 26.6 MB/s eta 0:00:01
Collecting scipy==1.5.4
Downloading scipy-1.5.4-cp36-cp36m-manylinux1_x86_64.whl (25.9 MB)
|████████████████████████████████| 25.9 MB 105.7 MB/s eta 0:00:01
Collecting h5py==3.1.0
Downloading h5py-3.1.0-cp36-cp36m-manylinux1_x86_64.whl (4.0 MB)
|████████████████████████████████| 4.0 MB 104.6 MB/s eta 0:00:01
Collecting joblib==1.0.1
Downloading joblib-1.0.1-py3-none-any.whl (303 kB)
|████████████████████████████████| 303 kB 94.6 MB/s eta 0:00:01
Collecting pycocotools==2.0.2
Downloading pycocotools-2.0.2.tar.gz (23 kB)
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.3.1-cp36-cp36m-manylinux1_x86_64.whl (1.1 MB)
|████████████████████████████████| 1.1 MB 100.0 MB/s eta 0:00:01
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages (from matplotlib==3.1.1->-r /home/ubuntu/tlt_cv_samples_v1.1.0/deps/requirements-pip.txt (line 4)) (2.4.7)
Requirement already satisfied: python-dateutil>=2.1 in /home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages (from matplotlib==3.1.1->-r /home/ubuntu/tlt_cv_samples_v1.1.0/deps/requirements-pip.txt (line 4)) (2.8.2)
Collecting cycler>=0.10
Downloading cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting cached-property
Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Requirement already satisfied: setuptools>=18.0 in /home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages (from pycocotools==2.0.2->-r /home/ubuntu/tlt_cv_samples_v1.1.0/deps/requirements-pip.txt (line 8)) (57.1.0)
Collecting cython>=0.27.3
Using cached Cython-0.29.24-cp36-cp36m-manylinux1_x86_64.whl (2.0 MB)
Requirement already satisfied: six in /home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages (from cycler>=0.10->matplotlib==3.1.1->-r /home/ubuntu/tlt_cv_samples_v1.1.0/deps/requirements-pip.txt (line 4)) (1.16.0)
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /home/ubuntu/.virtualenvs/launcher/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/setup.py’"’"’; file=’"’"’/tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /tmp/pip-wheel-hewi3e0y
cwd: /tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/
Complete output (65 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/init.py → build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/mask.py → build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/coco.py → build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/cocoeval.py → build/lib.linux-x86_64-3.6/pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools/_mask.c
/tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/.eggs/Cython-0.29.24-py3.6-linux-x86_64.egg/Cython/Compiler/Main.py:369: FutureWarning: Cython directive ‘language_level’ not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/pycocotools/_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building ‘pycocotools._mask’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/common
creating build/temp.linux-x86_64-3.6/pycocotools
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.6-t1GNlY/python3.6-3.6.14=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages/numpy/core/include -I./common -I/home/ubuntu/.virtualenvs/launcher/include -I/usr/include/python3.6m -c ./common/maskApi.c -o build/temp.linux-x86_64-3.6/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
./common/maskApi.c: In function ‘rleDecode’:
./common/maskApi.c:46:7: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
46 | for( k=0; k<R[i].cnts[j]; k++ ) (M++)=v; v=!v; }}
| ^~~
./common/maskApi.c:46:49: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
46 | for( k=0; k<R[i].cnts[j]; k++ ) (M++)=v; v=!v; }}
| ^
./common/maskApi.c: In function ‘rleFrPoly’:
./common/maskApi.c:166:3: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
166 | for(j=0; j<k; j++) x[j]=(int)(scale
xy[j
2+0]+.5); x[k]=x[0];
| ^~~
./common/maskApi.c:166:54: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
166 | for(j=0; j<k; j++) x[j]=(int)(scalexy[j2+0]+.5); x[k]=x[0];
| ^
./common/maskApi.c:167:3: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
167 | for(j=0; j<k; j++) y[j]=(int)(scalexy[j2+1]+.5); y[k]=y[0];
| ^~~
./common/maskApi.c:167:54: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
167 | for(j=0; j<k; j++) y[j]=(int)(scalexy[j2+1]+.5); y[k]=y[0];
| ^
./common/maskApi.c: In function ‘rleToString’:
./common/maskApi.c:212:7: warning: this ‘if’ clause does not guard… [-Wmisleading-indentation]
212 | if(more) c |= 0x20; c+=48; s[p++]=c;
| ^~
./common/maskApi.c:212:27: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
212 | if(more) c |= 0x20; c+=48; s[p++]=c;
| ^
./common/maskApi.c: In function ‘rleFrString’:
./common/maskApi.c:220:3: warning: this ‘while’ clause does not guard… [-Wmisleading-indentation]
220 | while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
| ^~~~~
./common/maskApi.c:220:22: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
220 | while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
| ^~~~
./common/maskApi.c:228:5: warning: this ‘if’ clause does not guard… [-Wmisleading-indentation]
228 | if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
| ^~
./common/maskApi.c:228:34: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
228 | if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
| ^~~~
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.6-t1GNlY/python3.6-3.6.14=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages/numpy/core/include -I./common -I/home/ubuntu/.virtualenvs/launcher/include -I/usr/include/python3.6m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.6/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
pycocotools/_mask.c:6:10: fatal error: Python.h: No such file or directory
6 | #include “Python.h”
| ^~~~~~~~~~
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

ERROR: Failed building wheel for pycocotools
Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: numpy, kiwisolver, cycler, matplotlib, cython, cached-property, scipy, pycocotools, pillow, joblib, h5py
Attempting uninstall: numpy
Found existing installation: numpy 1.19.5
Uninstalling numpy-1.19.5:
Successfully uninstalled numpy-1.19.5
Running setup.py install for pycocotools … error
ERROR: Command errored out with exit status 1:
command: /home/ubuntu/.virtualenvs/launcher/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/setup.py’"’"’; file=’"’"’/tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-ck6mb9qg/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/.virtualenvs/launcher/include/site/python3.6/pycocotools
cwd: /tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/
Complete output (63 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/init.py → build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/mask.py → build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/coco.py → build/lib.linux-x86_64-3.6/pycocotools
copying pycocotools/cocoeval.py → build/lib.linux-x86_64-3.6/pycocotools
running build_ext
skipping ‘pycocotools/_mask.c’ Cython extension (up-to-date)
building ‘pycocotools._mask’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/common
creating build/temp.linux-x86_64-3.6/pycocotools
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.6-t1GNlY/python3.6-3.6.14=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages/numpy/core/include -I./common -I/home/ubuntu/.virtualenvs/launcher/include -I/usr/include/python3.6m -c ./common/maskApi.c -o build/temp.linux-x86_64-3.6/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
./common/maskApi.c: In function ‘rleDecode’:
./common/maskApi.c:46:7: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
46 | for( k=0; k<R[i].cnts[j]; k++ ) (M++)=v; v=!v; }}
| ^~~
./common/maskApi.c:46:49: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
46 | for( k=0; k<R[i].cnts[j]; k++ ) (M++)=v; v=!v; }}
| ^
./common/maskApi.c: In function ‘rleFrPoly’:
./common/maskApi.c:166:3: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
166 | for(j=0; j<k; j++) x[j]=(int)(scale
xy[j
2+0]+.5); x[k]=x[0];
| ^~~
./common/maskApi.c:166:54: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
166 | for(j=0; j<k; j++) x[j]=(int)(scalexy[j2+0]+.5); x[k]=x[0];
| ^
./common/maskApi.c:167:3: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
167 | for(j=0; j<k; j++) y[j]=(int)(scalexy[j2+1]+.5); y[k]=y[0];
| ^~~
./common/maskApi.c:167:54: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
167 | for(j=0; j<k; j++) y[j]=(int)(scalexy[j2+1]+.5); y[k]=y[0];
| ^
./common/maskApi.c: In function ‘rleToString’:
./common/maskApi.c:212:7: warning: this ‘if’ clause does not guard… [-Wmisleading-indentation]
212 | if(more) c |= 0x20; c+=48; s[p++]=c;
| ^~
./common/maskApi.c:212:27: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
212 | if(more) c |= 0x20; c+=48; s[p++]=c;
| ^
./common/maskApi.c: In function ‘rleFrString’:
./common/maskApi.c:220:3: warning: this ‘while’ clause does not guard… [-Wmisleading-indentation]
220 | while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
| ^~~~~
./common/maskApi.c:220:22: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
220 | while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
| ^~~~
./common/maskApi.c:228:5: warning: this ‘if’ clause does not guard… [-Wmisleading-indentation]
228 | if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
| ^~
./common/maskApi.c:228:34: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
228 | if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
| ^~~~
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.6-t1GNlY/python3.6-3.6.14=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/ubuntu/.virtualenvs/launcher/lib/python3.6/site-packages/numpy/core/include -I./common -I/home/ubuntu/.virtualenvs/launcher/include -I/usr/include/python3.6m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.6/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
pycocotools/_mask.c:6:10: fatal error: Python.h: No such file or directory
6 | #include “Python.h”
| ^~~~~~~~~~
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/ubuntu/.virtualenvs/launcher/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/setup.py’"’"’; file=’"’"’/tmp/pip-install-lo2zdxgc/pycocotools_0659ecb118c14bdd8ac8a552b9e1cb2c/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-ck6mb9qg/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/.virtualenvs/launcher/include/site/python3.6/pycocotools Check the logs for full command output.
WARNING: You are using pip version 21.1.3; however, version 21.2.1 is available.
You should consider upgrading via the ‘/home/ubuntu/.virtualenvs/launcher/bin/python -m pip install --upgrade pip’ command.

Ok, I have this working. This only works on python 3.6.

The TLT Quick Start Software Requirements lists:

python >=3.6.9

Which to me reads anything above 3.6.9, including major versions. Perhaps this should be updated?

So, you get everything working well under python 3.6.9 ?

I’m running Python 3.6.14. I Haven’t quite finished going through the notebook in it’s entirety yet.

However, there are some other dependencies as I am going through the Notebook which are required which also are not listed as requirements (or in the DeepLearning Image), such as: libsm6, libxext6, python3-dev. I am fixing and installing these as I go.

I got almost through the notebook, but It fails on the deploy step (8)…

8. Deploy

!mkdir -p $LOCAL_EXPERIMENT_DIR/experiment_dir_final

Removing a pre-existing copy of the etlt if there has been any.

import os
output_file=os.path.join(os.environ[‘LOCAL_EXPERIMENT_DIR’],
“experiment_dir_final/gazenet_onnx.etlt”)
if os.path.exists(output_file):
os.system(“rm {}”.format(output_file))

!tlt gazenet export -m $USER_EXPERIMENT_DIR/experiment_result/exp1/model.tlt
-o $USER_EXPERIMENT_DIR/experiment_dir_final/gazenet_onnx.etlt
-t tfonnx
-k $KEY

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:95: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

2021-07-30 03:57:17,952 [WARNING] tensorflow: From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:95: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

Traceback (most recent call last):
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/driveix/build_wheel.runfiles/ai_infra/driveix/mitgazenet/scripts/export.py”, line 146, in
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/driveix/build_wheel.runfiles/ai_infra/driveix/mitgazenet/scripts/export.py”, line 142, in main
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/driveix/build_wheel.runfiles/ai_infra/driveix/common/utilities/tlt_utils.py”, line 411, in save_etlt_file
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/core/build_wheel.runfiles/ai_infra/moduluspy/modulus/export/_uff.py”, line 153, in keras_to_pb
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/core/build_wheel.runfiles/ai_infra/moduluspy/modulus/export/_uff.py”, line 110, in _reload_model_for_inference
File “/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py”, line 419, in load_model
model = _deserialize_model(f, custom_objects, compile)
File “/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py”, line 225, in _deserialize_model
model = model_from_config(model_config, custom_objects=custom_objects)
File “/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py”, line 458, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File “/usr/local/lib/python3.6/dist-packages/keras/layers/init.py”, line 55, in deserialize
printable_module_name=‘layer’)
File “/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py”, line 129, in deserialize_keras_object
if custom_objects and class_name in custom_objects:
TypeError: argument of type ‘int’ is not iterable
Traceback (most recent call last):
File “/usr/local/bin/gazenet”, line 8, in
sys.exit(main())
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/driveix/build_wheel.runfiles/ai_infra/driveix/mitgazenet/entrypoint/gazenet.py”, line 13, in main
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/driveix/build_wheel.runfiles/ai_infra/driveix/common/entrypoint/entrypoint.py”, line 300, in launch_job
AssertionError: Process run failed.

EDIT: Looks like I may have come across the same issue as here

This is an issue which is tracking.
Please remove “-t tfonnx” and retry.

Ok yes, it works without that.

Thank you very much for your assistance.

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