Coder Social home page Coder Social logo

Comments (1)

wanglong001 avatar wanglong001 commented on June 11, 2024

+1

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 522.30       CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0  On |                  N/A |
| N/A   49C    P8    19W /  N/A |   1480MiB /  6144MiB |     50%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

import onnx
import onnx_tensorrt.backend as backend
import numpy as np

model = onnx.load("model.onnx")
engine = backend.prepare(model, device="CUDA")
input_data = np.random.random(size=(1, 3, 224, 224)).astype(np.float32)
output_data = engine.run(input_data)[0]
print(output_data)
print(output_data.shape)
root@5644f2ca731e:/opt/test# python3 test_onnx.py
[11/22/2023-07:29:18] [TRT] [W] Unable to determine GPU memory usage
[11/22/2023-07:29:18] [TRT] [W] Unable to determine GPU memory usage
[11/22/2023-07:29:18] [TRT] [W] CUDA initialization failure with error: 35. Please check your CUDA installation:  http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
Traceback (most recent call last):
  File "/opt/test/test_onnx.py", line 6, in <module>
    engine = backend.prepare(model, device="CUDA")
  File "/usr/local/lib/python3.10/dist-packages/onnx_tensorrt-8.6.1-py3.10.egg/onnx_tensorrt/backend.py", line 238, in prepare
  File "/usr/local/lib/python3.10/dist-packages/onnx_tensorrt-8.6.1-py3.10.egg/onnx_tensorrt/backend.py", line 42, in __init__
TypeError: pybind11::init(): factory function returned nullptr

from onnx-tensorrt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.