FileNotFoundError: [WinError 2] The system cannot find the file specified but paths are correct

FileNotFoundError: [WinError 2] The system cannot find the file specified but paths are correct

我查看了其他 20 个不断收到此错误的人的帖子,none 个帮助我解决了我的问题。

我正在尝试将文件加载到 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:\Users\user\anaconda3\envs\virenv\lib\site-packages\openface\torch_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:\Users\user\Desktop\Diplomski\main2.py", line 39, in <module>
     net = openface.TorchNeuralNet(args.networkModel, args.imgDim)

   File "C:\Users\user\anaconda3\envs\virenv\lib\site- 
   packages\openface\torch_neural_net.py", line 
     84, in __init__
     self.p = Popen(self.cmd, stdin=PIPE, stdout=PIPE, bufsize=0, 
universal_newlines=True)

   File "C:\Users\user\anaconda3\envs\virenv\lib\site- 
        packages\spyder_kernels\customize\spydercustomize.py", line 108, in 
__init__
     super(SubprocessPopen, self).__init__(*args, **kwargs)

   File "C:\Users\user\anaconda3\envs\virenv\lib\subprocess.py", line 951, in __init__
     self._execute_child(args, executable, preexec_fn, close_fds,

   File "C:\Users\user\anaconda3\envs\virenv\lib\subprocess.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,我正在取得进展。