Commit c51b3528 authored by d_dree02's avatar d_dree02

Make caffe version executable search for 'caffe' without extension in addition to other options

parent a326394e
......@@ -142,17 +142,16 @@ class CaffepathDialog(QtWidgets.QDialog):
if os.path.exists(pythonpath):
self.LineEditPathtoPython.setText(pythonpath)
if len(str(self.LineEditPathtoBinaries.text())) == 0:
if self.platform == Platform.WINDOWS:
binarypath = os.path.join(ret, "build", "tools", "caffe.exe")
else:
binarypath = os.path.join(ret, "build", "tools", "caffe.bin")
if os.path.exists(binarypath):
self.LineEditPathtoBinaries.setText(binarypath)
# There are differnt variations on the name of the caffe binary, so we look for and accept any one of them
for binaryName in ["caffe.exe", "caffe", "caffe.bin"]:
binarypath = os.path.join(ret, "build", "tools", binaryName)
if os.path.isfile(binarypath):
self.LineEditPathtoBinaries.setText(binarypath)
break
if len(str(self.LineEditPathtoProto.text())) == 0:
protopath = os.path.join(ret, "src", "caffe", "proto", "caffe.proto")
if os.path.exists(protopath):
self.LineEditPathtoProto.setText(protopath)
def _onPythonFile(self):
"""if default path should be changed, show file dialog to chose a path """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment