Open doublexxking opened 6 years ago
need more log, maybe try
print(x.shape)
print(self.y_tensor.shape)
BTW, I assume that you meant tftrt_example.py
instead of trt_example.py
x.shape is (85, 224, 224, 3) y_tensor.shape is unknown
umm....I also print y.shape, which is (85,) So, I think the frozen graph has some problem? which comes from frozen_graph = FrozenGraph(model, (img_h, img_w, 3)) But I may not sure how to change your code. Could you share some your ideas?
Thanks in advance
If I change self.y_tensor.shape[1] to 17, which is my number of classes, the program will run successfully. But I also want to know what the problem of in your original code.
First, thanks for a great example of using TensorRT with Keras and TensorFlow!
I have similar error with tftrt_resnet_example.py.
I have to set self.y_tensor.shape[1] to 1000.
I'm using TensorRT 4 with tensorflow-gpu 1.11
I think the reason is that.
with the TfEngine(object):
This is y_op.outputs: [<tf.Tensor 'import/resnet50/fc1000/Softmax:0' shape=(?, 1000) dtype=float32>]
With the TftrtEngine(TfEngine):
The opt_graph is missing the shape of the output tensor.
This is y_op.outputs: [<tf.Tensor 'import/resnet50/fc1000/Softmax:0' shape=<unknown> dtype=float32>]
Have the same issue. Shape is missing for TftrtEngine
Hi Jeng, Thanks for your code firstly, I am trying to use your trt_example.py code to optimize my own h5 model. I change
frozen_graph = FrozenGraph(model, (img_h, img_w, 1)) to frozen_graph = FrozenGraph(model, (img_h, img_w, 3)) due to my input is RGB image.
But I got the following error:
I am not sure what the problem is. Any help from you is appreciate.