Comments (2)
check this issue : #9
from tracking-with-darkflow.
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)
- How can I get direction of Individual ID's?
- ModuleNotFound Error : No module named 'darkflow.cython_utils' while setting up on Google Colab
- Video is not getting saved
- When I run the code "python run.py" ,there is an error . how can I solve it? HOT 1
- the deep_sort weights provided by nwojke is cancelled HOT 8
- ssertionError: Cannot capture source HOT 1
- Not detecting people HOT 1
- darkflow
- Why is the target size different from that trained by Darknet after using this code?
- Hello, I use yolov2 trained by darknet and mark the head and shoulders of the person, but when I use the trained model in this code, I can only detect the head, not the head and shoulders. That is why ah! Does anyone have the same problem with me?
- doesn't save the video HOT 1
- Hello, I used darkflow training to generate four files, but how do I use it in the code?
- I trained yolov2 under darknet. The effect is not good when using this code. Why is this?
- Excuse me? Can this code use pb files? HOT 2
- OOM error
- The name 'net/images:0' refers to a Tensor which does not exist
- AVAssetWriter status: Cannot create file HOT 3
- Using Mask-RCNN for detection HOT 1
- What would be the guideline for multi camera tracking ?
- GPU memory usage 9G
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tracking-with-darkflow.