此代码用于运行我训练的权重,文件夹 ckpt 包含 1050 步训练数据,此文件位于 darkflow 主文件夹的 cfg 文件夹之外。
import cv2
from darkflow.net.build import TFNet
import numpy as np
import time
options = {
'model': 'cfg/tiny-yolo-voc-1c.cfg',
'load': 1050,
'threshold': 0.2,
'gpu': 1.0
}
在原子编辑器中运行此代码后,显示以下错误
Parsing cfg//tiny-yolo-voc-1c.cfg
Traceback (most recent call last):
File "C:\Users\amard\Desktop\Hotel\darkflow\test.py", line 13, in <module>
tfnet = TFNet(options)
File "C:\Users\amard\Desktop\Hotel\darkflow\darkflow\net\build.py", line 58, in __init__
darknet = Darknet(FLAGS)
File "C:\Users\amard\Desktop\Hotel\darkflow\darkflow\dark\darknet.py", line 17, in __init__
src_parsed = self.parse_cfg(self.src_cfg, FLAGS)
File "C:\Users\amard\Desktop\Hotel\darkflow\darkflow\dark\darknet.py", line 68, in parse_cfg
for i, info in enumerate(cfg_layers):
File "C:\Users\amard\Desktop\Hotel\darkflow\darkflow\utils\process.py", line 66, in cfg_yielder
layers, meta = parser(model); yield meta;
File "C:\Users\amard\Desktop\Hotel\darkflow\darkflow\utils\process.py", line 17, in parser
with open(model, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'cfg//tiny-yolo-voc-1c.cfg'
[Finished in 4.298s]