ROLO icon indicating copy to clipboard operation
ROLO copied to clipboard

How to run MOLO?

Open Jane333 opened this issue 8 years ago • 17 comments

I'd like to use the multiple object tracking on a video file but I'm not sure how to call the MOLO script properly.

In MOLO_network_test.py, I tried using the file name of my video as the value of the fromfile variable in the ROLO_TF class and using 'model_demo.ckpt' as the value of the rolo_weights_file variable. I then ran

MOLO_network_test.py

hoping for the best, but the error raise TypeError("'Tensor' object is not iterable.") occurred. Is this even the correct way to call this script? How do I pass any input video file to it? Where does the output land?

I'd be very thankful for any help.

Jane333 avatar Jan 09 '17 23:01 Jane333

@Jane333 Hi,I will run MOLO now,Then I see your issue. so can I have your contact such as Email so that we can contact conveniently

burui11087 avatar Feb 17 '17 08:02 burui11087

@burui11087 Hello, can I send you my e-mail address to [email protected]?

Meanwhile, I tried it again on another machine with Python 2.7.12.

I cloned the repo from https://github.com/Guanghan/ROLO, the latest commit being "6612007e35edb73dac734e7a4dac2cd4c1dca6c1", "update for tensorflow 0.11.0".

The only change I made to ROLO_network_test_all.py was to comment out the line

from tensorflow.models.rnn import rnn, rnn_cell

because neither rnn nor rnn_cell were not being used anywhere but this import was causing a No module named models.rnn error.

The file ROLO_network_test_all.py references YOLO_small.ckpt which I got from the link posted here: https://github.com/gliese581gg/YOLO_tensorflow

It also references the file /u03/Guanghan/dev/ROLO-dev/model_dropout_30.ckpt which I couldn't find anywhere, so I replaced it with model_demo.ckpt.

Now I'm getting these errors when I run python2 MOLO_network_test.py:

ROLO init Utils init self.cfgPath= Testing MOLO... Traceback (most recent call last): File "MOLO_network_test.py", line 265, in <module> main(' ') File "MOLO_network_test.py", line 262, in main ROLO_TF(argvs) File "MOLO_network_test.py", line 94, in __init__ self.ROLO(argvs) File "MOLO_network_test.py", line 258, in ROLO self.test_7() File "MOLO_network_test.py", line 173, in test_7 self.build_networks() File "MOLO_network_test.py", line 135, in build_networks self.lstm_module = self.LSTM_single('lstm_test', self.x, self.istate, self.weights, self.biases) File "MOLO_network_test.py", line 104, in LSTM_single _X = tf.split(0, self.num_steps, _X) # n_steps * (batch_size, num_input) File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1216, in split split_dim=axis, num_split=num_or_size_splits, value=value, name=name) File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3426, in _split num_split=num_split, name=name) File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 509, in apply_op (prefix, dtypes.as_dtype(input_arg.type).name)) TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.

Thanks again for your help!

Jane333 avatar Feb 19 '17 21:02 Jane333

@Jane333 yes,you can contact me by using that email address.

My environment is same with yours,and my tensorflow version is larger than 0.11.0.I think No module named models.rnn error is caused by the version too new.

Firstly,for the /u03/Guanghan/dev/ROLO-dev/model_dropout_30.ckpt you can find that at the main website of ROLO, it is supported in the Models module.

Secondly, I haven't run the MOLO_network_test.py, but when I see your output, I think there are many problems , like self.cfgPath= ,there is no path.

I have a question that I can't find the file named " model_MOT.ckpt",so I always get error because of it. I want to know did you get that file? thanks.

I will run test.py right now,and when I solve your problem I will response to you

burui11087 avatar Feb 20 '17 02:02 burui11087

@Jane333 HI,I solve your problem,

I modified the code in MOLO_network_test.py,line 77 'x = tf.placeholder("int32", [None, num_steps, num_input])'.["float32"->"int32"]

But now, I have a new problem that

Traceback (most recent call last):
  File "MOLO_network_train.py", line 310, in <module>
    main(' ')
  File "MOLO_network_train.py", line 307, in main
    ROLO_TF(argvs)
  File "MOLO_network_train.py", line 92, in __init__
    self.ROLO(argvs)
  File "MOLO_network_train.py", line 303, in ROLO
    self.train_7()
  File "MOLO_network_train.py", line 159, in train_7
    self.build_networks()
  File "MOLO_network_train.py", line 147, in build_networks
    self.lstm_module = self.LSTM_single('lstm_test', self.x, self.istate, self.weights, self.biases)
  File "MOLO_network_train.py", line 106, in LSTM_single
    cell = tf.nn.rnn_cell.LSTMCell(self.num_input, self.num_input)
AttributeError: 'module' object has no attribute 'rnn_cell'

I think it also caused by the version of TF

Can you tell me your contact method? I want to keep in touch with you

THANKS

burui11087 avatar Feb 20 '17 06:02 burui11087

Hello Jane333 and burui11087, Do you guys work out how MOLO works? I am just reading the code, found that the num_predict=6, I am wondering how does this work for multiple object detection? How can 6 values encode multiple locations? Do you have any idea?

SHMCU avatar Mar 07 '17 19:03 SHMCU

Hello @Jane333, @burui11087, @SHMCU Do you know what is application of using seq_dets in MOLO? I successfully run and use ROLO. in Rolo we just use 'yolo_out/' and 'gt/gt.txt' . But in MOLO, they used seq_dets.
seq_dets = np.loadtxt('3rd_party/sort-master/output/%s.txt'%(sequence_name),delimiter=',') could you successfully run Molo?

masoumeh1 avatar Apr 06 '17 08:04 masoumeh1

@burui11087 The error that you are getting is due to tensorflow version mismatch , you might want to do it the following way for tensorflow v1.0

    def LSTM_single(self, name,  _X, _istate, _weights, _biases):
        with tf.device('/gpu:0'):
            # input shape: (batch_size, n_steps, n_input)
            _X = tf.transpose(_X, [1, 0, 2])  # permute num_steps and batch_size
            # Reshape to prepare input to hidden activation
            _X = tf.reshape(_X, [self.num_steps * self.batch_size, self.num_input]) # (num_steps*batch_size, num_input)
            # Split data because rnn cell needs a list of inputs for the RNN inner loop
            #_X = tf.split(0, self.num_steps, _X) # n_steps * (batch_size, num_input)
            _X = tf.split(_X, self.num_steps , 0) # n_steps * (batch_size, num_input)
            
        #cell = tf.nn.rnn_cell.LSTMCell(self.num_input, self.num_input)
        cell = tf.contrib.rnn.LSTMCell(self.num_input, state_is_tuple=False)
        #print(_X.shape)
        state = _istate

       
        for step in range(self.num_steps):
            #outputs, state = tf.nn.rnn(cell, [_X[step]], state)
            outputs, state = tf.contrib.rnn.static_rnn(cell, [_X [step] ], state, dtype=tf.float32)
            tf.get_variable_scope().reuse_variables()
        return outputs

rishabh135 avatar Apr 18 '17 18:04 rishabh135

Has anyone been able to run MOLO on a file , what I find strange is that the seq_dets require same number of bboxes per line , but in a MOLO ,there will be continuous movement of object and hence , it is extremely unlikely that there will be a constant number of objects in the frame , how do we get past that ?

rishabh135 avatar May 01 '17 08:05 rishabh135

@masoumeh1 Can you please share the corrected code to run ROLO and the tensorflow version you are using. I am facing many problems while running ROLO on tensorflow version 0.11.0rc2.

ashishbedi avatar May 09 '17 10:05 ashishbedi

@masoumeh1 @rishabh135 Did you find out how to use MOLO file (both test and train)? Because, as you mentioned, there is a line or hard to find the path, which isn't described in anywhere.

seq_dets = np.loadtxt('3rd_party/sort-master/output/%s.txt'%(sequence_name),delimiter=',')

Please let me know your idea.

Thank you in advance.

flipflop98 avatar Jul 11 '17 11:07 flipflop98

@masoumeh1 Sorry for such delayed reply. I was unable to run MOLO. I used SSD network to replace Yolo network for multiple object detection. I am experimenting with it recently.

SHMCU avatar Sep 16 '17 21:09 SHMCU

@SHMCU Thank you for your kind responses to the masoumeh1 question. Could you share the MOLO code you are currently using? Then, it will be really helpful for me. Here is my email. [email protected].

flipflop98 avatar Sep 30 '17 19:09 flipflop98

Hey @burui11087 @Jane333 @SHMCU Did you figure out how to run MOLO? my email is [email protected]

HassanZaalVIBOT avatar Feb 22 '18 11:02 HassanZaalVIBOT

@burui11087 @Jane333 @SHMCU @masoumeh1 @rishabh135 Did you figure out how to run MOLO?

sunshinezhihuo avatar Mar 30 '18 09:03 sunshinezhihuo

@Jane333 @burui11087 @SHMCU @masoumeh1 @rishabh135 @flipflop98 hello. Did you find out how to use MOLO file :seq_dets = np.loadtxt('3rd_party/sort-master/output/%s.txt'%(sequence_name),delimiter=',') ? thank you in advance for your help.

bouthaynaabdallah avatar Apr 09 '18 14:04 bouthaynaabdallah

@rishabh135 hello,I use tensorflow1.3 +python3.5 in Windows I change the LSTM_single like yours, but when I run ROLO_network_test_all.py still has the error: ValueError: Variable rnn/lstm_cell/kernel does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope? how to solve it? thank u

Tomingz avatar Apr 13 '18 11:04 Tomingz

@Jane333 @burui11087 @SHMCU @masoumeh1 @rishabh135 @flipflop98 Any update guys ? Thanks

anandcu3 avatar Oct 08 '18 07:10 anandcu3