Installed dlib and face_recognition as per solution of Installing dlib with python3.6 in Jetson Nano .
I’m able to run face_recognition on cpu. but when I try to offload to GPU it gives error.
import face_recognition
image = face_recognition.load_image_file(“/home/batsy/Downloads/my_face.jpg”)
face_locations = face_recognition.face_locations(image)
the above code works. The following code fails:-
import face_recognition
image = face_recognition.load_image_file(“/home/batsy/Downloads/my_face.jpg”)
face_locations = face_recognition.face_locations(image, model=“cnn”)
Following is the error:-
File “trial_0.py”, line 3, in
face_locations = face_recognition.face_locations(image, model=“cnn”)
File “/home/batsy/.local/lib/python3.6/site-packages/face_recognition/api.py”, line 119, in face_locations
return [_trim_css_to_bounds(_rect_to_css(face.rect), img.shape) for face in _raw_face_locations(img, number_of_times_to_upsample, “cnn”)]
File “/home/batsy/.local/lib/python3.6/site-packages/face_recognition/api.py”, line 103, in _raw_face_locations
return cnn_face_detector(img, number_of_times_to_upsample)
RuntimeError: Error while calling cudnnFindConvolutionBackwardDataAlgorithm( context(), (const cudnnFilterDescriptor_t)filter_handle, descriptor(dest_desc), (const cudnnConvolutionDescriptor_t)conv_handle, descriptor(data), num_possible_algorithms, &num_algorithms, perf_results.data()) in file /tmp/pip-build-yrtsvnza/dlib/dlib/cuda/cudnn_dlibapi.cpp:856. code: 4, reason: A call to cuDNN failed
cudaStreamDestroy() failed. Reason: the launch timed out and was terminated
cudaFree() failed. Reason: the launch timed out and was terminated