convert_to_uff

Hi Experts

I am trying to run the sample “end-to-end tensorflow mnist” python. I have a model lenet5.pb and I need to run:

python convert_to_uff models/lenet5.pb

The file convert_to_uff is in my folder:

usr/lib/python3.6/dist-packages/uff/bin/

Do I need to copy the file or run:

python usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py models/lenet5.pb

What is the best way?

When I run the above statement I get an error:

python: can’t open file ‘usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py’: [Errno 2] No such file or directory

Thanks,

sojohan

It should be:

python /usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py models/lenet5.pb

Hi Junytang

Thanks.

But then I got this error messages:

Traceback (most recent call last):
File “/usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py”, line 15, in
import uff
ModuleNotFoundError: No module named ‘uff’

Regards,
Sojohan

Hi,

The path is within python3 and should be executed with python3:

<b>python3</b> /usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py models/lenet5.pb

Thanks.

Hi AastaLLL

so far so good. But when I run the

python3 sample.py -d /usr/src/tensorrt/python/data/mnist/1.pgm

I get an error that pycuda is not installed.

I then use the following command:

python3 -m pip install -r requirements.txt

I get several pages of errors and the last part is below. Any hints?

running install_lib
creating /usr/local/lib/python3.6/dist-packages/pycuda
error: could not create ‘/usr/local/lib/python3.6/dist-packages/pycuda’: Permission denied
----------------------------------------
ERROR: Command “/usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’”’"’/tmp/pip-install-sntio0hl/pycuda/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-record-6zjn5eok/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-sntio0hl/pycuda/

Thanks
sojohan

Hi,

You can get pyCUDA installed with the following commands:

$ sudo apt-get install python3-pip libhdf5-serial-dev hdf5-tools
$ pip3 install pycuda --user

Thanks.

Hi AastaLLL

That worked I am now able to make predictions…
python3 sample.py

Thanks,

Sojohans