It looks like you're new here. If you want to get involved, click one of these buttons!Sign In
It looks like you're new here. If you want to get involved, click one of these buttons!
I am experimenting with the application Video_face_matcher_multiFace which uses Facenet.
I made some changes in the code which reads images. And I'm having the following error:
Traceback (most recent call last):
File "./matcher.py", line 349, in
File "./matcher.py", line 322, in main
out, _ = run_inference(validated_image, graph)
File "./matcher.py", line 57, in run_inference
out, userobj = get_graph_result(facenet_graph, im.astype(numpy.float16))
File "./matcher.py", line 34, in get_graph_result
File "/usr/local/lib/python3.5/dist-packages/mvnc/mvncapi.py", line 253, in LoadTensor
Graph recompilation didn't help. Any ideas what could have caused this error?
Here is the part of main() which I changed:
use_camera = True
# Get a list of ALL the sticks that are plugged in # we need at least one devices = mvnc.EnumerateDevices() if len(devices) == 0: print('No NCS devices found') quit() # Pick the first stick to run the network device = mvnc.Device(devices) # Open the NCS device.OpenDevice() # The graph file that was created with the ncsdk compiler graph_file_name = GRAPH_FILENAME # read in the graph file to memory buffer with open(graph_file_name, mode='rb') as f: graph_in_memory = f.read() # create the NCAPI graph instance from the memory buffer containing the graph file. graph = device.AllocateGraph(graph_in_memory) face_vectors = 
for person in white_list:
person_imgs = os.listdir(os.path.join('./validated_images/', person))
person_vectors = 
tmp = 
for i in person_imgs: validated_image = cv2.imread(os.path.join("./validated_images/", person, i)) out, _ = run_inference(validated_image, graph) if(len(out) != 0): person_vectors.append(out) tmp.append(out) # numpy.ndarray.flatten(out)) tmp = numpy.array(tmp).astype('float32') # Use k-means to separate data into clusters: k = round(max(1, len(tmp) / 4)) compactness, labels, centers = cv2.kmeans(tmp, k, None, (cv2.TERM_CRITERIA_COUNT|cv2.TERM_CRITERIA_EPS, 1000, 0.001), 10, cv2.KMEANS_PP_CENTERS) face_vec = get_kmeans_clusters(person_vectors, labels, len(centers)) face_vectors.append(face_vec) #face_vector = numpy.zeros(valid_output.shape)
In fact, graph can load without a problem any two tensors and then it fails to load any third tensor, no matter which pictures I give it.
Thank you a lot in advance