darkflow
darkflow copied to clipboard
NameError: name 'exit' is not defined, tf.train
Trying out an object detection video similar to this GitHub out here https://github.com/deep-diver/Soccer-Ball-Detection-YOLOv2/blob/master/YOLOv2-Train.ipynb
But when I run tf.train()
I get this error
NameError Traceback (most recent call last)
~/darkflow/darkflow/net/flow.py in train(self) 38 loss_op = self.framework.loss 39 ---> 40 for i, (x_batch, datum) in enumerate(batches): 41 if not i: self.say(train_stats.format( 42 self.FLAGS.lr, self.FLAGS.batch,
~/darkflow/darkflow/net/yolo/data.py in shuffle(self) 95 def shuffle(self): 96 batch = self.FLAGS.batch ---> 97 data = self.parse() 98 size = len(data) 99
~/darkflow/darkflow/net/yolo/data.py in parse(self, exclusive) 14 if not os.path.isdir(ann): 15 msg = 'Annotation directory not found {} .' ---> 16 exit('Error: {}'.format(msg.format(ann))) 17 print('\n{} parsing {}'.format(meta['model'], ann)) 18 dumps = pascal_voc_clean_xml(ann, meta['labels'], exclusive)
NameError: name 'exit' is not
Any solution to this?
@HarishDechiraju i got the exact same error for a while in colab, the thing is while building the model using " pip3 install -e ." make sure u are doing it on same directory, dont just copy the entire directory are building it build it on the go
Hi guys, I am having the same error and I have done whar @krishna223412 said, however it is still not working.
Has someone any tip for this?
Cheers
So the problem is in /darkflow/utils/process.py.
Apparently sys
package has the exit() method and it is not in-built in Python(at least not in the latest version of Python 3).
So in process.py add:
from sys import exit
I did what @Debangsha1992 said but this is still not working for me... Any other ideas?