Windows SSD Caffe [英] windows SSD caffe

查看:132
本文介绍了Windows SSD Caffe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人,当我测试 ssd_pascal_video.py 在Windows中,出现以下错误:

everyone,when I test ssd_pascal_video.py in windows,I got the following error:

    E:\caffe-ssd-microsoft\Build\x64\Release\pycaffe>python E:\caffe-ssd-microsoft\examples\ssd\ssd_pascal_webcam.py --cpu
  Traceback (most recent call last):
  File "E:\caffe-ssd-microsoft\examples\ssd\ssd_pascal_webcam.py", line 151, in <module>
  for file in os.listdir(snapshot_dir):
     WindowsError: [Error 3] : 'models/VGGNet/VOC0712/SSD_300x300/*.*'

然后,我检查ssd_pascal_video.py,找到以下代码,我不明白地址中"{}"的含义.

then,I check the ssd_pascal_video.py,I find the following code,I can't understand the meaning of "{}"in the address.

   # The job name should be same as the name used in examples/ssd/ssd_pascal.py.
   job_name = "SSD_{}".format(resize)
   # The name of the model. Modify it if you want.
   model_name = "VGG_VOC0712_{}".format(job_name)

   # Directory which stores the model .prototxt file.
  save_dir = "models/VGGNet/VOC0712/{}_video".format(job_name)
  # Directory which stores the snapshot of trained models.
  snapshot_dir = "models/VGGNet/VOC0712/{}".format(job_name)
  # Directory which stores the job script and log file.
  job_dir = "jobs/VGGNet/VOC0712/{}_video".format(job_name)

  # model definition files.
  test_net_file = "{}/test.prototxt".format(save_dir)
  # snapshot prefix.
  snapshot_prefix = "{}/{}".format(snapshot_dir, model_name)
  # job script path.
  job_file = "{}/{}.sh".format(job_dir, model_name)

  # Find most recent snapshot.
  max_iter = 0
  for file in os.listdir(snapshot_dir):
  if file.endswith(".caffemodel"):
  basename = os.path.splitext(file)[0]
  iter = int(basename.split("{}_iter_".format(model_name))[1])
  if iter > max_iter:
   max_iter = iter

推荐答案

'{}' #formatstrings"rel =" nofollow noreferrer> .format() python中的运算符.
基本上,字符串中的每个{}都将替换为.format()中的相应值.

The '{}' in the strings in part of the .format() operator in python.
Basically, each {} in string is replaced by the corresponding value in the .format().

这篇关于Windows SSD Caffe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆