Code Monkey home page Code Monkey logo

tensorrt-demo's People

Contributors

dkorobchenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tensorrt-demo's Issues

Optimize frozen TF graph and prepare a stand-alone TensorRT inference engine error

root@14cab064210e:/xiesibo/tensorrt-demo-master# python trt_optimize.py
WARNING: Logging before flag parsing goes to stderr.
W0820 07:21:20.667007 140699697792768 deprecation_wrapper.py:119] From /usr/local/lib/python3.5/dist-packages/uff/converters/tensorflow/conversion_helpers.py:18: The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead.

W0820 07:21:20.667487 140699697792768 deprecation_wrapper.py:119] From /usr/local/lib/python3.5/dist-packages/uff/converters/tensorflow/conversion_helpers.py:231: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

NOTE: UFF has been tested with TensorFlow 1.12.0. Other versions are not guaranteed to work
WARNING: The version of TensorFlow installed on this system is not guaranteed to work with UFF.
W0820 07:21:22.477570 140699697792768 deprecation_wrapper.py:119] From /usr/local/lib/python3.5/dist-packages/graphsurgeon/_utils.py:2: The name tf.NodeDef is deprecated. Please use tf.compat.v1.NodeDef instead.

UFF Version 0.6.3
=== Automatically deduced input nodes ===
[name: "net/input"
op: "Placeholder"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "shape"
value {
shape {
dim {
size: 1
}
dim {
size: 224
}
dim {
size: 224
}
dim {
size: 3
}
}
}
}
]

Using output node net/plate/BiasAdd
Using output node net/blet/BiasAdd
Converting to UFF graph
No. nodes: 92
[TensorRT] ERROR: UFFParser: Validator error: net/plate/BiasAdd: Unsupported operation Identity
***parser <tensorrt.tensorrt.UffParser object at 0x7ff6e677d0d8>
[TensorRT] ERROR: Network must have at least one output
Traceback (most recent call last):
File "trt_optimize.py", line 49, in
f.write(engine.serialize())
AttributeError: 'NoneType' object has no attribute 'serialize'

get a very low precision

hi, I get a very low precision using tensorRT, but get 0.9580 using tf. here is my code:

def network(inputs, is_training=True, **kwargs):
#Lenet + BatchNorm
with tf.variable_scope('net'):
with slim.arg_scope([slim.conv2d, slim.fully_connected],
activation_fn=tf.nn.relu,
weights_initializer=tf.truncated_normal_initializer(0.0, 0.01),
weights_regularizer=slim.l2_regularizer(0.0005)):
with slim.arg_scope([slim.conv2d],
normalizer_fn=slim.batch_norm,
normalizer_params={'is_training': is_training}):
net = slim.conv2d(inputs, 32, [5, 5], scope='conv1')
net = slim.max_pool2d(net, [2, 2], scope='pool1')
net = slim.conv2d(net, 64, [5, 5], scope='conv2')
net = slim.max_pool2d(net, [2, 2], scope='pool2')
net = slim.flatten(net)
net = slim.fully_connected(net, 1024, scope='fc1')
net = slim.dropout(net, 0.5, scope='dropout', is_training=is_training)
net = slim.fully_connected(net, 10, activation_fn=None, scope='fc2')
return net

why the Graph output_names =['net/fc8/BiasAdd']?

first i think you did a very great job,i am appreciate for it,however when i try to run the demo, i meet some problems like this: InvalidArgumentError (see above for traceback): LossTensor is inf or nan : Tensor had NaN values

[[Node: train_op/CheckNumerics = CheckNumerics[T=DT_FLOAT, _class=["loc:@train_op/control_dependency"], message="LossTensor is inf or nan", _device="/job:localhost/replica:0/task:0/device:GPU:0"](loss/sparse_softmax_cross_entropy_loss/value, ^net/conv5_2/BatchNorm/AssignMovingAvg_1, ^net/conv1_1/BatchNorm/AssignMovingAvg, ^net/conv1_1/BatchNorm/AssignMovingAvg_1, ^net/conv2_1/BatchNorm/AssignMovingAvg, ^net/conv2_1/BatchNorm/AssignMovingAvg_1, ^net/conv3_1/BatchNorm/AssignMovingAvg, ^net/conv3_1/BatchNorm/AssignMovingAvg_1, ^net/conv3_2/BatchNorm/AssignMovingAvg, ^net/conv3_2/BatchNorm/AssignMovingAvg_1, ^net/conv4_1/BatchNorm/AssignMovingAvg, ^net/conv4_1/BatchNorm/AssignMovingAvg_1, ^net/conv4_2/BatchNorm/AssignMovingAvg, ^net/conv4_2/BatchNorm/AssignMovingAvg_1, ^net/conv5_1/BatchNorm/AssignMovingAvg, ^net/conv5_1/BatchNorm/AssignMovingAvg_1, ^net/conv5_2/BatchNorm/AssignMovingAvg)]]
[[Node: train_op/control_dependency/_421 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_699_train_op/control_dependency", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]
i know there might be some reason for it , i don't know what the reason is,so maybe you can help me ,thank you very much ,what's more,why the output node name is net/fc8/BiasAdd, i think the output node name might be conv5_2/BatchNorm/AssigMovingAvg ,plz tell me which one is the right answer and why,thanks

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.