Running python (tensorrt samples)

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.10.0
[1]DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
[1]Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
[1]DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
2.1.0
[1]other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Issue Description
Hi team, On host, I could see some python samples under /usr/src/tensorrt/samples/python.
I want to execute the network_api_pytorch_mnist sample. I tried installing the dependencies from requirements.txt file. But I got the below errors. What could be the reasons?
Or Do I need to copy all the samples from host to target and build it on target itself?

ignore the requirements.txt, or manually edit it. best is to run the sample it will prompt for missing pip packages. always use a virtual environment as well better pip-package isolation.

Dear @akshay.tupkar ,
Could you please use text message instead of images for logs for all your future topics.

Yes. I dont se any issue when running pythoin sample ditrectly on target.

nvidia@tegra-ubuntu:/usr/src/tensorrt/samples/python/network_api_pytorch_mnist$ python3 sample.py
Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
Failed to download (trying next):
HTTP Error 404: Not Found

Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz
Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz to /tmp/mnist/data/MNIST/raw/train-images-idx3-ubyte.gz
100%|███████████████████████████████████████████████████████████████████████| 9912422/9912422 [00:04<00:00, 2362436.19it/s]
Extracting /tmp/mnist/data/MNIST/raw/train-images-idx3-ubyte.gz to /tmp/mnist/data/MNIST/raw

Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
Failed to download (trying next):
HTTP Error 404: Not Found

Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz
Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz to /tmp/mnist/data/MNIST/raw/train-labels-idx1-ubyte.gz
100%|████████████████████████████████████████████████████████████████████████████| 28881/28881 [00:00<00:00, 117873.54it/s]
Extracting /tmp/mnist/data/MNIST/raw/train-labels-idx1-ubyte.gz to /tmp/mnist/data/MNIST/raw

Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
Failed to download (trying next):
HTTP Error 404: Not Found

Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz
Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz to /tmp/mnist/data/MNIST/raw/t10k-images-idx3-ubyte.gz
100%|████████████████████████████████████████████████████████████████████████| 1648877/1648877 [00:01<00:00, 943887.41it/s]
Extracting /tmp/mnist/data/MNIST/raw/t10k-images-idx3-ubyte.gz to /tmp/mnist/data/MNIST/raw

Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
Failed to download (trying next):
HTTP Error 404: Not Found

Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz
Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz to /tmp/mnist/data/MNIST/raw/t10k-labels-idx1-ubyte.gz
100%|████████████████████████████████████████████████████████████████████████████| 4542/4542 [00:00<00:00, 16994227.27it/s]
Extracting /tmp/mnist/data/MNIST/raw/t10k-labels-idx1-ubyte.gz to /tmp/mnist/data/MNIST/raw

Train Epoch: 1 [0/60000 (0%)]   Loss: 2.313610
Train Epoch: 1 [6400/60000 (11%)]       Loss: 0.601012
Train Epoch: 1 [12800/60000 (21%)]      Loss: 0.286917
Train Epoch: 1 [19200/60000 (32%)]      Loss: 0.277789
Train Epoch: 1 [25600/60000 (43%)]      Loss: 0.146727
Train Epoch: 1 [32000/60000 (53%)]      Loss: 0.140967
Train Epoch: 1 [38400/60000 (64%)]      Loss: 0.136560
Train Epoch: 1 [44800/60000 (75%)]      Loss: 0.052772
Train Epoch: 1 [51200/60000 (85%)]      Loss: 0.041543
Train Epoch: 1 [57600/60000 (96%)]      Loss: 0.157574

Test set: Average loss: 0.0884, Accuracy: 9749/10000 (97%)

Train Epoch: 2 [0/60000 (0%)]   Loss: 0.070697
Train Epoch: 2 [6400/60000 (11%)]       Loss: 0.054531
Train Epoch: 2 [12800/60000 (21%)]      Loss: 0.075649
Train Epoch: 2 [19200/60000 (32%)]      Loss: 0.054936
Train Epoch: 2 [25600/60000 (43%)]      Loss: 0.022699
Train Epoch: 2 [32000/60000 (53%)]      Loss: 0.014617
Train Epoch: 2 [38400/60000 (64%)]      Loss: 0.061728
Train Epoch: 2 [44800/60000 (75%)]      Loss: 0.014672
Train Epoch: 2 [51200/60000 (85%)]      Loss: 0.064870
Train Epoch: 2 [57600/60000 (96%)]      Loss: 0.111935

Test set: Average loss: 0.0592, Accuracy: 9817/10000 (98%)

sample.py:112: DeprecationWarning: Use set_memory_pool_limit instead.
  config.max_workspace_size = common.GiB(1)
sample.py:75: DeprecationWarning: Use add_convolution_nd instead.
  conv1 = network.add_convolution(
sample.py:78: DeprecationWarning: Use stride_nd instead.
  conv1.stride = (1, 1)
sample.py:80: DeprecationWarning: Use add_pooling_nd instead.
  pool1 = network.add_pooling(input=conv1.get_output(0), type=trt.PoolingType.MAX, window_size=(2, 2))
sample.py:81: DeprecationWarning: Use stride_nd instead.
  pool1.stride = (2, 2)
sample.py:85: DeprecationWarning: Use add_convolution_nd instead.
  conv2 = network.add_convolution(pool1.get_output(0), 50, (5, 5), conv2_w, conv2_b)
sample.py:86: DeprecationWarning: Use stride_nd instead.
  conv2.stride = (1, 1)
sample.py:88: DeprecationWarning: Use add_pooling_nd instead.
  pool2 = network.add_pooling(conv2.get_output(0), trt.PoolingType.MAX, (2, 2))
sample.py:89: DeprecationWarning: Use stride_nd instead.
  pool2.stride = (2, 2)
Test Case: 7
Prediction: 7

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