Converting Tensorflow to UFF using C++ API

Hello,
My hardware include: jetson tx2 that reflash with Jetpack 3.2.1. i makefile sampleUffMNIST completely.

I am trying to convert a Tensorflow model to UFF parser.
i have 2 questions:

  1. Jetson tx2 only use C++ API. Is it true?
  2. I follow sampleUffMNIST.cpp and i programming , the problem occur when i include"NvUffParser.h"

here is my code:

"
#include “NvUffParser.h”
#include “NvInfer.h”
#include “NvUtils.h”
#include <stdio.h>
main()
{
printf(“Hello\n”);
}
"

I compile with gcc on terminal : "gcc -o hello untitled.cpp "

here are errors:
#################

error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
^
In file included from /usr/include/aarch64-linux-gnu/NvUffParser.h:53:0,
from untitled.cpp:3:
/usr/include/aarch64-linux-gnu/NvInfer.h: In constructor ‘nvinfer1::DimsHW::DimsHW()’:
/usr/include/aarch64-linux-gnu/NvInfer.h:165:23: error: ‘DimensionType’ is not a class or namespace
type[0] = type[1] = DimensionType::kSPATIAL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h: In constructor ‘nvinfer1::DimsHW::DimsHW(int, int)’:
/usr/include/aarch64-linux-gnu/NvInfer.h:177:23: error: ‘DimensionType’ is not a class or namespace
type[0] = type[1] = DimensionType::kSPATIAL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h: In constructor ‘nvinfer1::DimsCHW::DimsCHW()’:
/usr/include/aarch64-linux-gnu/NvInfer.h:221:13: error: ‘DimensionType’ is not a class or namespace
type[0] = DimensionType::kCHANNEL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h:222:23: error: ‘DimensionType’ is not a class or namespace
type[1] = type[2] = DimensionType::kSPATIAL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h: In constructor ‘nvinfer1::DimsCHW::DimsCHW(int, int, int)’:
/usr/include/aarch64-linux-gnu/NvInfer.h:236:13: error: ‘DimensionType’ is not a class or namespace
type[0] = DimensionType::kCHANNEL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h:237:23: error: ‘DimensionType’ is not a class or namespace
type[1] = type[2] = DimensionType::kSPATIAL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h: In constructor ‘nvinfer1::DimsNCHW::DimsNCHW()’:
/usr/include/aarch64-linux-gnu/NvInfer.h:295:13: error: ‘DimensionType’ is not a class or namespace
type[0] = DimensionType::kINDEX;
^
/usr/include/aarch64-linux-gnu/NvInfer.h:296:13: error: ‘DimensionType’ is not a class or namespace
type[1] = DimensionType::kCHANNEL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h:297:23: error: ‘DimensionType’ is not a class or namespace
type[2] = type[3] = DimensionType::kSPATIAL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h: In constructor ‘nvinfer1::DimsNCHW::DimsNCHW(int, int, int, int)’:
/usr/include/aarch64-linux-gnu/NvInfer.h:312:13: error: ‘DimensionType’ is not a class or namespace
type[0] = DimensionType::kINDEX;
^
/usr/include/aarch64-linux-gnu/NvInfer.h:313:13: error: ‘DimensionType’ is not a class or namespace
type[1] = DimensionType::kCHANNEL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h:314:23: error: ‘DimensionType’ is not a class or namespace
type[2] = type[3] = DimensionType::kSPATIAL;
^
/usr/include/aarch64-linux-gnu/NvInfer.h: At global scope:
/usr/include/aarch64-linux-gnu/NvInfer.h:386:2: error: ‘int64_t’ does not name a type
int64_t count; //!< the number of weights in the array
^
/usr/include/aarch64-linux-gnu/NvInfer.h: In member function ‘virtual nvinfer1::CalibrationAlgoType nvinfer1::IInt8EntropyCalibrator::getAlgorithm()’:
/usr/include/aarch64-linux-gnu/NvInfer.h:2744:54: error: ‘CalibrationAlgoType’ is not a class or namespace
virtual CalibrationAlgoType getAlgorithm() { return CalibrationAlgoType::kENTROPY_CALIBRATION; }
^
/usr/include/aarch64-linux-gnu/NvInfer.h: In member function ‘virtual nvinfer1::CalibrationAlgoType nvinfer1::IInt8LegacyCalibrator::getAlgorithm()’:
/usr/include/aarch64-linux-gnu/NvInfer.h:2758:54: error: ‘CalibrationAlgoType’ is not a class or namespace
virtual CalibrationAlgoType getAlgorithm() { return CalibrationAlgoType::kENTROPY_CALIBRATION; }
^
In file included from untitled.cpp:3:0:
/usr/include/aarch64-linux-gnu/NvUffParser.h: At global scope:
/usr/include/aarch64-linux-gnu/NvUffParser.h:87:59: error: ‘UffInputOrder’ is not a class or namespace
UffInputOrder inputOrder = UffInputOrder::kNCHW) = 0;
^
/usr/include/aarch64-linux-gnu/NvUffParser.h:103:67: error: ‘nvinfer1::DataType’ is not a class or namespace
nvinfer1::DataType weightsType = nvinfer1::DataType::kFLOAT) = 0;
^
/usr/include/aarch64-linux-gnu/NvUffParser.h:114:73: error: ‘nvinfer1::DataType’ is not a class or namespace
nvinfer1::DataType weightsType = nvinfer1::DataType::kFLOAT) = 0;

#############
What happened with my program? and how can i fix it.
Thanks

hello,

  1. yes. python api is not currently supported on jetson
  2. double check your make file for -std=c++11 or -std=gnu++11 compiler options. Reference example makefiles.