Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

TF TensorRT misconfigured

Đang mở
#1,323 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, python, tensorflow
Lĩnh vực
infrastructure

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện sự không khớp phiên bản TensorRT trong image Kaggle được tham chiếu, sử dụng các kiểm tra phiên bản được liên kết/được nạp trong Python và mẫu chuyển đổi ResNet50 tối thiểu. Kiểm tra cấu hình TensorFlow TensorRT xung quanh trt_convert.py và các gói TensorRT đã cài đặt trong container. Được coi là hoàn tất khi các phiên bản được liên kết và được nạp khớp nhau và mẫu chạy mà không gặp segmentation fault.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug help wanted

🐛 Bug

Tensorflow TensorRT seems to be wrongly linked.

To Reproduce

On a few recent images (including gcr.io/kaggle-gpu-images/python latest 311277776c9b 7 days ago 47.2GB) I see very different linked and loaded TensorRT libs, namely 8.4 vs 8.6.

import tensorflow.compiler as tf_cc
linked_trt_ver=tf_cc.tf2tensorrt._pywrap_py_utils.get_linked_tensorrt_version()
print(f"Linked TRT ver: {linked_trt_ver}")
loaded_trt_ver=tf_cc.tf2tensorrt._pywrap_py_utils.get_loaded_tensorrt_version()
print(f"Loaded TRT ver: {loaded_trt_ver}")
# Linked TRT ver: (8, 4, 3)
# Loaded TRT ver: (8, 6, 1)

This has been Python. Now, the system inference libraries are indeed at 8.6:

dpkg -l | grep TensorRT

Now, minimal compatibility rules are fulfilled - the loaded version more recent.

However, the linking doesn't work properly. Under these recent containers, minimal TensorRT samples crash:

import tensorflow as tf
from tensorflow.python.compiler.tensorrt import trt_convert as trt
from tensorflow.python.saved_model import signature_constants
from tensorflow.python.saved_model import tag_constants

from tensorflow.keras.applications.resnet50 import ResNet50
tf_model_dir = './models/tf_model'
model = ResNet50(include_top=50, weights='imagenet')
model.save(tf_model_dir)

converter = trt.TrtGraphConverterV2(  
   input_saved_model_dir=tf_model_dir,
)
converter.convert()

MAX_BATCH_SIZE=1 
def input_fn():
   img = tf.random.normal((MAX_BATCH_SIZE, 224,224,3),dtype=tf.float32)
   return (img, )

import faulthandler
faulthandler.enable()
converter.build(input_fn=input_fn) #SEGMENTATION FAULT can happen under missconfigured software!
Expected behavior

Align versions and make the sample code runnable.

Additional context

See the NVIDIA installation guidelines

Conditions from `tensorrt

        "Loaded TensorRT %s but linked TensorFlow against TensorRT %s. A few "
        "requirements must be met:\n"
        "\t-It is required to use the same major version of TensorRT during "
        "compilation and runtime.\n"
        "\t-TensorRT does not support forward compatibility. The loaded "
        "version has to be equal or more recent than the linked version.",
Ngôn ngữ chính
Python
Star
2.7k
Fork
1k
Merge trung bình
5 giờ 55 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Kaggle/docker-python

Tất cả issue của Kaggle/docker-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.