Custom mnist architecture classification on jetson nano

Hi. i used my own architecture to train a mnist model with tensorflow 1.15.
i saved my model and build a frozen graph .pb file.
after that i convert the .pb file to .uff file with convert_to_uff.py script that come from with jetpack.
i using jetpack 4.5 and tensorflow 1.15
for making a TRT engine i get this error :

[TensorRT] ERROR: UffParser: Could not open /home/plate/project/tensorrt_demos/my_mnist/models/my_model.uff
[TensorRT] ERROR: Network must have at least one output
[TensorRT] ERROR: Network validation failed.
Traceback (most recent call last):
File “/home/plate/project/tensorrt_demos/my_mnist/test.py”, line 64, in
main()
File “/home/plate/project/tensorrt_demos/my_mnist/test.py”, line 50, in main
with build_engine(model_file) as engine:
AttributeError: enter

plz help me to solve this problem.

Hi,

UffParser: Could not open /home/plate/project/tensorrt_demos/my_mnist/models/my_model.uff

Could you validate if the file exist or not first?
Thanks.

my bad sorry. my model was in the my_mnist directory. i run it again and get this error:

[TensorRT] ERROR: conv2d_1/convolution: kernel weights has count 8064 but 288 was expected
[TensorRT] ERROR: conv2d_1/convolution: count of 8064 weights in kernel, but kernel dimensions (3,3) with 1 input channels, 32 output channels and 1 groups were specified. Expected Weights count is 1 * 33 * 32 / 1 = 288
[TensorRT] ERROR: conv2d_1/convolution: kernel weights has count 8064 but 288 was expected
[TensorRT] ERROR: conv2d_1/convolution: count of 8064 weights in kernel, but kernel dimensions (3,3) with 1 input channels, 32 output channels and 1 groups were specified. Expected Weights count is 1 * 3
3 * 32 / 1 = 288
[TensorRT] ERROR: conv2d_1/convolution: kernel weights has count 8064 but 288 was expected
[TensorRT] ERROR: conv2d_1/convolution: count of 8064 weights in kernel, but kernel dimensions (3,3) with 1 input channels, 32 output channels and 1 groups were specified. Expected Weights count is 1 * 3*3 * 32 / 1 = 288
[TensorRT] ERROR: UffParser: Parser error: conv2d_1/BiasAdd: The input to the Scale Layer is required to have a minimum of 3 dimensions.
[TensorRT] ERROR: Network must have at least one output
[TensorRT] ERROR: Network validation failed.
Traceback (most recent call last):
File “/home/plate/project/tensorrt_demos/my_mnist/test.py”, line 64, in
main()
File “/home/plate/project/tensorrt_demos/my_mnist/test.py”, line 50, in main
with build_engine(model_file) as engine:
AttributeError: enter

Hi,

Which source do you use for deploying?

It seems that your input dimension is changed.
If yes, please also update the script accordingly.

Thanks.

the problem was the input shape. my model input shape is (28,28,1) and the script code that i used was (1,28,28). i finally create and save trt model. tnx