PSPNet
PSPNet copied to clipboard
Python or C++ predict scripts?
Hi, is there python or C++ scripts available?
With python, you can using this script demo.zip
Thanks @ThienAnh. That was helpful.
@ThienAnh Thanks for your code. But there is a problem.
python demo.py
Traceback (most recent call last):
File "demo.py", line 17, in
ImportError: libmatio.so.2: cannot open shared object file: No such file or directory
gzyaoxin@edt-machine02-machine:~/ImageProject/PSPNET-cudnn5/evaluation$ python
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import caffe
there are a ImportError about libmatio.so.2 in your code. I have already installed matio and import caffe succesfully when i do not modify sys.path.
But it seems to be a little different between the caffe in this project and official version. So using official version directly cause a other error.
How to solve this problem?
See your issue in https://github.com/hszhao/PSPNet/issues/14
@ThienAnh Thank you very much!
@YaoXinatTHU you are wellcome
@ThienAnh Hi ThienAnh, do you happen to have the prediction code for c++?? :-) Will appreciate your response. Thank you so much!!
Anyone who has a copy of a c++ prediction code can also response by helping me.
@pewpewpeww I will share c++ code tonight. (Now i had out of office)
@ThienAnh Thank you very much for your help!! :-) I referred to the code and realised that it requires a Utility.h file to run. Do you have it too?
@ThienAnh How the C++ inference speed on CPU?
@pewpewpeww Utility.h only common funtions for read image, convert string2char. You can ignore it.
@jinfagang I don't test on CPU. (So i think it is very low)
@ThienAnh Thank you so much. The code predict sample in c++ works. When i use the function called "predict" , I got a error "Check failed: error == cudaSuccess (2 vs. 0) out of memory" .I know it means my gpu memory may be small (about 11GB) . So i was thinking is there some key words like "batch_size" which i could modified. By the way , I use test prototxt file "pspnet101_cityscapes_713.prototxt" ,but there isn't "batch_size" or something like that .Do you have any idea? Any way , thank you ,thank you,thank you . Hi, I solve this problem by modified input size from 713 to 463 and some kernel and strides. And i got another problem,. when i predict an image ,i got a result without anything just white. Do you have any idea?
@cobbwho default of batch_size is 1. Because if batch_size>1 --> Will be out of memory. An idea for memory, you can split network to 2 or 3 or more parts, but performace will be slow
@jinfagang I test a image about 473*473. GPU version use about 0.4s . CPU version use about 6.5s. It's too slow.
@ThienAnh thank you .emmmm,I'm so sorry that the problem about "out of memory" I mentioned is a mistake . "batch_size" only happened in trainning progress., but the probleam hanppened in my prediction progress. I modified the input size from 713 to 473 ,and it's work. Any way ,thank you . I noticed another issue#75 about the predict result is wrong result . I have the same problem as you. I read the prediction code you uploaded called "PredictSample.zip" and I think It's right ,but the result is wrong too. At least the result is correct before forward delivery. But after a forward pass, the output data is 0 in output_layer. Seriously, I don't know why. Did you get the right result now?