Open gauravspatil opened 6 years ago
Hello,
Quite a strange error you've got there. If I'm not mistaken 'exit' should be a built-in constant. The reason it reaches there is because it didn't find an implementation for the layer in d['type']. Could you inspect the value of d['type'] before the exit?
There could be a workaround for all of this, if you say that you've successfully loaded the weights from command line:
flow --model cfg/yolov2_608.cfg --load bin/yolov2_608.weights --savepb
from darkflow.net.build import TFNet
options = {"metaLoad": "built_graph/yolov2_608.meta", "pbLoad": "built_graph/yolov2_608.pb", "threshold": 0.1, "gpu": 1.0}
tfnet = TFNet(options)
I see the same error when trying to import yolov3:
options = {'model': path + 'darknet/cfg/yolov3.cfg', 'load': path + 'darknet/yolov3.weights', 'threshold': 0.6}
tfnet = TFNet(options)
File "/Users/glennjocher/Documents/PyCharmProjects/Velocity/venv/lib/python3.6/site-packages/darkflow/utils/process.py", line 316, in cfg_yielder
exit('Layer {} not implemented'.format(d['type']))
NameError: name 'exit' is not defined
Attempting to produce a .pb for yolov3 likewise seems to fail. No error is sown, however I can't find a new *.pb anywhere:
$ flow --model /Users/glennjocher/darknet/cfg/yolov3.cfg --load /Users/glennjocher/darknet/yolov3.weights --savepb
Parsing ./cfg/yolov3.cfg
Layer [shortcut] not implemented
Testing python flow --model cfg/yolov3.cfg --load bin/yolov3.weights --demo ./video.mp4 --gpu 1.0 --saveVideo and having this error Parsing ./cfg/yolov3.cfg Layer [shortcut] not implemented
Problem occurs when using Yolov3, change to Yolov2
I am facing the same issue, I have downloaded the weights file from https://pjreddie.com/media/files/yolo.weights
Hello, Any fix for the error? I am going through the same issue for a custom trained tiny yolo v3 model.
I downloaded the yolov2 608x608 .cfg and .weights files trained on the coco dataset from here and I'm running this code
from darkflow.net.build import TFNet options = options = {"model": "cfg/yolov2_608.cfg", "load": "bin/yolov2_608.weights", "threshold": 0.1, "gpu": 1.0} tfnet = TFNet(options)
I get this error
Parsing ./cfg/yolov2_608.cfg Traceback (most recent call last):
File "", line 3, in
tfnet = TFNet(options)
File "C:\Users\CDS Lab\Downloads\darkflow-master\darkflow\net\build.py", line 58, in init darknet = Darknet(FLAGS)
File "C:\Users\CDS Lab\Downloads\darkflow-master\darkflow\dark\darknet.py", line 17, in init src_parsed = self.parse_cfg(self.src_cfg, FLAGS)
File "C:\Users\CDS Lab\Downloads\darkflow-master\darkflow\dark\darknet.py", line 68, in parse_cfg for i, info in enumerate(cfg_layers):
File "C:\Users\CDS Lab\Downloads\darkflow-master\darkflow\utils\process.py", line 316, in cfg_yielder exit('Layer {} not implemented'.format(d['type']))
NameError: name 'exit' is not defined
I have no idea what is causing this. I have successfully loaded and used the .cfg and .weights files trained on the voc dataset and they have worked fine.