required arguments:-d INPUT_NAME INPUT_DIM, --input_dim INPUT_NAME INPUT_DIM The names and dimensions of the network input layers specified in the format [input_name comma-separated-dimensions], for example: 'data' 1,224,224,3 Note that the quotes should always be included in order to handle special characters, spaces, etc. For multiple inputs specify multiple --input_dim on the command line like: --input_dim 'data1' 1,224,224,3 --input_dim 'data2' 1,50,100,3--out_node OUT_NAMES, --out_name OUT_NAMES Name of the graph's output Tensor Names. Multiple output names should be provided separately like: --out_name out_1 --out_name out_2--input_network INPUT_NETWORK, -i INPUT_NETWORK Path to the source framework model.
[ --input_dlc=<val> ] Path to the dlc container containing the model for which fixed-point encoding metadata should be generated. This argument is required.[ --input_list=<val> ] Path to a file specifying the trial inputs. This file should be a plain text file, containing one or more absolute file paths per line. These files will be taken to constitute the trial set. Each path is expected to point to a binary file containing one trial input in the 'raw' format, ready to be consumed by the tool without any further modifications. This is similar to how input is provided to snpe-net-run application.[ --output_dlc=<val> ] Path at which the metadata-included quantized model container should be written. If this argument is omitted, the quantized model will be written at <unquantized_model_name>_quantized.dlc.
import osimport numpy as npinput_path_list =[]BASE_PATH = "/tmp/RandomInputsForInceptionV3"if not os.path.exists(BASE_PATH): os.mkdir(BASE_PATH)# generate 10 random inputs and save as rawNUM_IMAGES = 10#binary filesfor img in range(NUM_IMAGES): filename = "input_{}.raw".format(img) randomTensor = np.random.random((1, 299, 299, 3)).astype(np.float32) filename = os.path.join(BASE_PATH, filename) randomTensor.tofile(filename) input_path_list.append(filename)#for saving as input_list textwith open("input_list.txt", "w") as f: for path in input_path_list: f.write(path) f.write("\n")
import osimport numpy as npinput_path_list =[]BASE_PATH = "/tmp/RandomInputsForInceptionV3"if not os.path.exists(BASE_PATH): os.mkdir(BASE_PATH)# generate 10 random inputs and save as rawNUM_IMAGES = 10#binary filesfor img in range(NUM_IMAGES): filename = "input_{}.raw".format(img) randomTensor = np.random.random((1, 299, 299, 3)).astype(np.float32) filename = os.path.join(BASE_PATH, filename) randomTensor.tofile(filename) input_path_list.append(filename)#for saving as input_list textwith open("input_list.txt", "w") as f: for path in input_path_list: f.write(path) f.write("\n")
import osimport numpy as npinput_path_list =[]BASE_PATH = "/tmp/RandomInputsForInceptionV3"if not os.path.exists(BASE_PATH): os.mkdir(BASE_PATH)# generate 10 random inputs and save as rawNUM_IMAGES = 10#binary filesfor img in range(NUM_IMAGES): filename = "input_{}.raw".format(img) randomTensor = np.random.random((1, 299, 299, 3)).astype(np.float32) filename = os.path.join(BASE_PATH, filename) randomTensor.tofile(filename) input_path_list.append(filename)#for saving as input_list textwith open("input_list.txt", "w") as f: for path in input_path_list: f.write(path) f.write("\n")