Code Monkey home page Code Monkey logo

Comments (2)

obendidi avatar obendidi commented on May 12, 2024

check this issue : #9

from tracking-with-darkflow.

saranya-1 avatar saranya-1 commented on May 12, 2024

I tried both the ways mentioned in Issue #9 but it still not working when i am trying to run for multiple videos. After here is my run.py and error .Please help in solving the issue. Where should I include tf.reset_default_graph()?

Run.py
from darkflow.darkflow.defaults import argHandler #Import the default arguments
import os
from darkflow.darkflow.net.build import TFNet

topdir = 'D:\Videos'
FLAGS = argHandler()
FLAGS.setDefaults()

for root, dirs, files in os.walk(topdir, topdown=False):
for name in files:

    FLAGS.demo = "D:\\Videos"+name# video file to use, or if camera just put "camera"
    FLAGS.model = "darkflow/cfg/yolo.cfg" # tensorflow model
    FLAGS.load = "darkflow/bin/yolo.weights" # tensorflow weights
    FLAGS.threshold = 0.5 # threshold of decetion confidance (detection if confidance > threshold )
    FLAGS.gpu = 0.75 #how much of the GPU to use (between 0 and 1) 0 means use cpu
    FLAGS.track = True # wheither to activate tracking or not
    FLAGS.trackObj = "person" # the object to be tracked
    FLAGS.saveVideo = True  #whether to save the video or not
    FLAGS.BK_MOG = False # activate background substraction using cv2 MOG substraction,
							#to help in worst case scenarion when YOLO cannor predict(able to detect mouvement, it's not ideal but well)
							# helps only when number of detection < 5, as it is still better than no detection.
    FLAGS.tracker = "deep_sort" # wich algorithm to use for tracking deep_sort/sort (NOTE : deep_sort only trained for people detection )
    FLAGS.skip = 3# how many frames to skipp between each detection to speed up the network
    FLAGS.csv = True #whether to write csv file or not(only when tracking is set to True)
    FLAGS.display = True # display the tracking or not
    tfnet = TFNet(FLAGS)         
    tfnet.camera()

exit('Demo stopped, exit.')


Error :
Traceback (most recent call last):
File "C:\Users\13067_000\Tracking-with-darkflow\run.py", line 30, in
tfnet.camera()
File "C:\Users\13067_000\Tracking-with-darkflow\darkflow\darkflow\net\help.py", line 83, in camera
os.path.abspath("deep_sort/resources/networks/mars-small128.ckpt-68577"))
File "C:\Users\13067_000\Tracking-with-darkflow\deep_sort\generate_detections.py", line 348, in create_box_encoder
image_encoder = create_image_encoder(model_filename, batch_size, loss_mode)
File "C:\Users\13067_000\Tracking-with-darkflow\deep_sort\generate_detections.py", line 343, in create_image_encoder
model_filename, loss_mode)
File "C:\Users\13067_000\Tracking-with-darkflow\deep_sort\generate_detections.py", line 314, in _create_image_encoder
preprocessed_image_var, l2_normalize=l2_normalize, reuse=None)
File "C:\Users\13067_000\Tracking-with-darkflow\deep_sort\generate_detections.py", line 224, in factory_fn
weight_decay=weight_decay)
File "C:\Users\13067_000\Tracking-with-darkflow\deep_sort\generate_detections.py", line 111, in _create_network
weights_regularizer=conv_regularizer)
File "C:\Python35\lib\site-packages\tensorflow\contrib\framework\python\ops\arg_scope.py", line 181, in func_with_args
return func(*args, **current_args)
File "C:\Python35\lib\site-packages\tensorflow\contrib\layers\python\layers\layers.py", line 1033, in convolution
outputs = layer.apply(inputs)
File "C:\Python35\lib\site-packages\tensorflow\python\layers\base.py", line 671, in apply
return self.call(inputs, *args, **kwargs)
File "C:\Python35\lib\site-packages\tensorflow\python\layers\base.py", line 559, in call
self.build(input_shapes[0])
File "C:\Python35\lib\site-packages\tensorflow\python\layers\convolutional.py", line 143, in build
dtype=self.dtype)
File "C:\Python35\lib\site-packages\tensorflow\python\layers\base.py", line 458, in add_variable
trainable=trainable and self.trainable)
File "C:\Python35\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1203, in get_variable
constraint=constraint)
File "C:\Python35\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1092, in get_variable
constraint=constraint)
File "C:\Python35\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 417, in get_variable
return custom_getter(**custom_getter_kwargs)
File "C:\Python35\lib\site-packages\tensorflow\contrib\layers\python\layers\layers.py", line 1539, in layer_variable_getter
return _model_variable_getter(getter, *args, **kwargs)
File "C:\Python35\lib\site-packages\tensorflow\contrib\layers\python\layers\layers.py", line 1531, in _model_variable_getter
custom_getter=getter, use_resource=use_resource)
File "C:\Python35\lib\site-packages\tensorflow\contrib\framework\python\ops\arg_scope.py", line 181, in func_with_args
return func(*args, **current_args)
File "C:\Python35\lib\site-packages\tensorflow\contrib\framework\python\ops\variables.py", line 262, in model_variable
use_resource=use_resource)
File "C:\Python35\lib\site-packages\tensorflow\contrib\framework\python\ops\arg_scope.py", line 181, in func_with_args
return func(*args, **current_args)
File "C:\Python35\lib\site-packages\tensorflow\contrib\framework\python\ops\variables.py", line 217, in variable
use_resource=use_resource)
File "C:\Python35\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 394, in _true_getter
use_resource=use_resource, constraint=constraint)
File "C:\Python35\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 742, in _get_single_variable
name, "".join(traceback.format_list(tb))))
ValueError: Variable conv1_1/weights already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

File "C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 1470, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
File "C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 2956, in create_op
op_def=op_def)
File "C:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)

from tracking-with-darkflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.