GithubHelp home page GithubHelp logo

ling-bao / mscnn Goto Github PK

View Code? Open in Web Editor NEW
93.0 93.0 36.0 2.54 MB

mscnn crowd counting model implementation, source from "Multi-scale Convolution Neural Networks for Crowd Counting" write by Zeng L, Xu X, Cai B, et al.

Home Page: https://arxiv.org/abs/1702.02359

License: GNU General Public License v3.0

Python 100.00%
crowd-counting deep-learning

mscnn's People

Contributors

ling-bao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mscnn's Issues

UCF__CC__50训练shapes不匹配

感谢开源的代码,我在UCF__CC__50数据集上训练了一下模型,但是一直报shapes不匹配的错误,请问怎么解决?

dir_name.txt

what is the content of dir_text in dataset file

can you help me with an alternative download link, because I don't have a Baidu account?

or

help explain the name of the dataset file used, how many, and what are the contents

ValueError: setting an array element with a sequence.

您好 运行mscnn_train程序时,将百度云盘的数据路径加入后

Instructions for updating:
Use tf.global_variables_initializer instead.
Not found checkpoint file
WARNING:tensorflow:Passing a GraphDef to the SummaryWriter is deprecated. Pass a Graph object instead, such as sess.graph.
Traceback (most recent call last):
File "D:/视频/人群计数论文/mscnn-master/mscnn_train.py", line 161, in
tf.app.run()
File "D:\python3.5\lib\site-packages\tensorflow\python\platform\app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "D:/视频/人群计数论文/mscnn-master/mscnn_train.py", line 157, in main
train()
File "D:/视频/人群计数论文/mscnn-master/mscnn_train.py", line 119, in train
_, loss_value = sess.run([train_op, loss], feed_dict={image: np_xs, label: np_ys})
File "D:\python3.5\lib\site-packages\tensorflow\python\client\session.py", line 767, in run
run_metadata_ptr)
File "D:\python3.5\lib\site-packages\tensorflow\python\client\session.py", line 938, in _run
np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
File "D:\python3.5\lib\site-packages\numpy\core\numeric.py", line 492, in asarray
return array(a, dtype, copy=False, order=order)

报这个错误 是不是需要将图片统一处理为同一大小

number of class

Hi, I want to know the meaning of classification part. There are 10 classes, and what's the meaning of them?

Model structure does not consist with the original paper.

Appreciate you for sharing this code. But I found that the model structure in your code differed from what the paper described in that : the network in the original paper contains three MSBs of size 4 and two MSBs of size 3.But the MSBs in your network structure are all of size 4.

估计密度图的生成

我看你的密度图的生成,使用npy只能生成标签密度图,怎样才能生成估计的密度图呢?谢谢

Code does not converge

Dear Ling,

Thank your very much for providing this open source. But I encountered some problems to run your code.

image
which happens when you delete the forth dimension by using the function image_out = tf.squeeze(con_out, 3) in the file mscnn.py

image
tmp1 will be None value in the second iteration since it cannot be assigned to other value by the while loop. This part code is not available.

image
After I make some correction to your code, finally I can run the training code. But after hours of training, there is no sign the training goes to converge.

Is that possible to provide your pre-trained model to reproduce the result in the paper?

Best wishes,
Long LI

please make dataset available in dropbox

Hi,
I tried to download ShanghaiTech Dataset from Baidu Yun using your password. But it is downloading NetDisk client executable, which I do not want to install in my computing machine. Can you please make the dataset available in Dropbox?
Is the dataset the same as what is shared in the ShanghaiTech official website or is it preprocessed?
thanks a lot!
B.R

mscnn_eval.py results

Training the model for 48 hours on the Dataset using mscnn_train.py appears to show the model converging, however I understand that further training time might be required i.e. the full 100k steps.

However, when running mscnn_eval.py on a snapshot, the following output is observed:

time: 10.645102999999999 loss_value: inf counting:172.0000040 predict:4326801291354836713957490688.0000000 diff:-4326801291354836713957490688.0000000 ./mscnn_eval.py:108: RuntimeWarning: overflow encountered in multiply sum_all_mse += sum_ab * sum_ab

As you can seem, the predicted value and loss value do not make sense. Is the evaluation routine broken?

After editing mscnn_eval.py to use the batch norm version of the inference method (as used by mscnn_train.py):

#predict_op = mscnn.inference(images)
predict_op = mscnn.inference_bn(images)

The results now seem more sensible:

time: 0.2461100000000016 loss_value: 18.351429 counting:370.9999983 predict:327.6858826 diff:43.3141174
time: 0.24157399999999996 loss_value: 13.386545 counting:501.9999339 predict:500.1551819 diff:1.8447571
time: 0.21929399999999788 loss_value: 24.295664 counting:1067.9998121 predict:985.3113403 diff:82.6884155
time: 0.2419879999999992 loss_value: 37.284615 counting:320.9999975 predict:236.7593231 diff:84.2406769

Is this the correct thing to do?

train.py : ERROR

InvalidArgumentError (see above for traceback): Incompatible shapes: [1,192,256] vs. [1,192,256,1]
[[Node: sub = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_9)]]
[[Node: gradients/msb_con6/concat/BiasAdd_grad/BiasAddGrad/_135 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_479_gradients/msb_con6/concat/BiasAdd_grad/BiasAddGrad", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

密度图

输出的密度图如何查看?

测试结果

你好,谢谢你放出的代码让我们可以学习。最近我运行了你的代码,发现了最后的误差非常大,请问是什么原因呢?谢谢!

how to generate a true annotation

   您好,我最近的工作用到了mscnn作为对比算法,请问在制作数据集的时候,对于生成的annotation矩阵,是不是要将坐标放缩到原图的1/4

训练时长

请问这个代码大概需要训练多长时间?我在GPU上已经跑了一周了还没有结束

数据集mat文件怎么转换成npy的呢?

你的方法很好,谢谢你提供了一个这么好的方法。但是我在训练自己的数据的时候,打开原数据集数,数据对应的是人头的坐标,你是按照什么规则转换成你数据集的npy文件的呢?求解答。

Can't download data set

Hi! I'm from Chile and I can't download data set... Do you have any other source to get it? Thanks.

Getting Incompatible shapes error

Nihou!

I'm getting this error. I'm using only single gpu with batch_size=1

InvalidArgumentError (see above for traceback): Incompatible shapes: [1,91,160] vs. [1,90,160]
[[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]

Cant access data from the link provided.

Hey Thanks for this implementation for the mscnn.
The problem here is that i am unable to access the shangaitech data in the desired format.
Can you please provide an updated link or the dataset itself in the format you used in your implementation?
Thanks.

While trying to train this model on my customized dataset it gives an error :InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,1088,1920] [[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]

File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[{{node sub}} = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "mscnn_train.py", line 159, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "mscnn_train.py", line 155, in main
train()
File "mscnn_train.py", line 117, in train
_, loss_value = sess.run([train_op, loss], feed_dict={image: np_xs, label: np_ys})
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]

Caused by op 'sub', defined at:
File "mscnn_train.py", line 159, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "mscnn_train.py", line 155, in main
train()
File "mscnn_train.py", line 63, in train
loss = mscnn.loss(predicts, label) # 计算损失
File "/workspace/mscnn/mscnn.py", line 326, in loss
l2_loss = tf.reduce_sum((predict - label) * (predict - label))
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/math_ops.py", line 866, in binary_op_wrapper
return func(x, y, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 8318, in sub
"Sub", x=x, y=y, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3274, in create_op
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1770, in init
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]

some mistakes

Dear Ling,

Thank your very much for providing this open source. But I I have a problem, please help me
1
.

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.