我查看了其他20个不断收到这个错误的人的帖子,他们都没有帮我解决问题。
我正在尝试将一个文件加载到TorchNeuralNet中,用于人脸验证。
parser = argparse.ArgumentParser()
parser.add_argument('--images', type=str, nargs='+', help="Input Images.")
parser.add_argument('--dlibFacePredictor', type=str, help="Path to dlib's face predictor.",
default=os.path.join(dlibModelDir,"landmarks.dat"))
parser.add_argument('--networkModel', type=str, help="Path to Torch network model.",
default=os.path.join(openfaceModelDir, "nn4.small2.v1.t7"))
parser.add_argument('--imgDim', type=str, help="Default image dimension.", default=96)
parser.add_argument('--verbose', action=('store_true'))
args = parser.parse_args()
错误发生在这一行。
net = openface.TorchNeuralNet(args.networkModel, args.imgDim)
一开始我以为问题出在文件的路径上,但事实并非如此。我检查了可变资源管理器,解析器可以保存它。
错误完整错误为:
Exception ignored in: <function TorchNeuralNet.__del__ at 0x00000235C5A80D30>
Traceback (most recent call last):
File "C:Usersuseranaconda3envsvirenvlibsite-packagesopenfacetorch_neural_net.py", line 109, in __del__
if self.p.poll() is None:
AttributeError: 'TorchNeuralNet' object has no attribute 'p'
Traceback (most recent call last):
File "C:UsersuserDesktopDiplomskimain2.py", line 39, in <module>
net = openface.TorchNeuralNet(args.networkModel, args.imgDim)
File "C:Usersuseranaconda3envsvirenvlibsite-
packagesopenfacetorch_neural_net.py", line
84, in __init__
self.p = Popen(self.cmd, stdin=PIPE, stdout=PIPE, bufsize=0,
universal_newlines=True)
File "C:Usersuseranaconda3envsvirenvlibsite-
packagesspyder_kernelscustomizespydercustomize.py", line 108, in
__init__
super(SubprocessPopen, self).__init__(*args, **kwargs)
File "C:Usersuseranaconda3envsvirenvlibsubprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:Usersuseranaconda3envsvirenvlibsubprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
以下是openface的文档:https://openface-api.readthedocs.io/en/latest/openface.html
OpenFace的解析器也不能很好地与Windows配合使用。尝试了一些Docker的东西,但没有成功。过渡到dlib和opencv,正在取得进展。