Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about test time #1

Open
yyytq opened this issue Jan 7, 2016 · 25 comments
Open

about test time #1

yyytq opened this issue Jan 7, 2016 · 25 comments

Comments

@yyytq
Copy link

yyytq commented Jan 7, 2016

thank you very much for your code sharing. Is it possible to tell me the test time of the three levels? or can you give a proportion of the time cost of different level?
thx again!!!

@luoyetx
Copy link
Owner

luoyetx commented Jan 7, 2016

you can test the model via python2.7 test/test.py 1 for level-1 and 2,3 for level-2 & level-3, it will give you error and speed test over test dataset. And don't forget to set the model path correctly in common/cnns.py

@yyytq
Copy link
Author

yyytq commented Jan 7, 2016

yeah. i test it. but i don't know if there is something wrong, the whole time for the network is about 1+ s per image, which i think is too long. i wonder if you ever saved the result of the test time for each level?

@luoyetx
Copy link
Owner

luoyetx commented Jan 7, 2016

I test the model on a 2.2 GHz CPU, it doesn't perform that bad, Actually I got the result below.

level1: 218fps
level2: 80fps
level3; 50fps

@yyytq
Copy link
Author

yyytq commented Jan 7, 2016

thank you very much for your sharing! !! i will check my work again~~~~(>_<)~~~~

@sshhuu110
Copy link

@luoyetx First of all thanks for sharing the code.

Can this code run in Linux OS Ubuntu?

When I was running this code, I got below error

Traceback (most recent call last):
File "dataset/level1.py", line 16, in
from common import shuffle_in_unison_scary, logger, createDir, processImage
ImportError: No module named common

Please suggest how to run this code in Ubuntu? Thanks in advance !!!

@luoyetx
Copy link
Owner

luoyetx commented Jan 7, 2016

@sshhuu110 I'm using CentOS but I don't think the OS is the problem. I think you run your script like python2.7 level1.py, but you should run the script under the root directory of the project like python2.7 dataset/level1.py. You can refer to this scipt bootstrap.sh.

@sshhuu110
Copy link

@luoyetx Thanks, The code is running. But how does it take to run on a CPU. What is the training time?

@luoyetx
Copy link
Owner

luoyetx commented Jan 11, 2016

all prototxt files are generate by python code generate.py. The default device is GPU.

About the training time. It really depends on the GPU. And you should tuning the CNNs carefully which can cost much time.

@sshhuu110
Copy link

I changed it to CPU, I started running on Friday and it is still running. Any suggestions, is it normal training time?

@luoyetx
Copy link
Owner

luoyetx commented Jan 11, 2016

I don't recommend you to use CPU which will be very slow. What's more, you should change the max_iter in solver.prototxt.template under prototxt. The default max_iter is very large and you may run many days under CPU 😂

@yyytq
Copy link
Author

yyytq commented Jan 26, 2016

@luoyetx @sshhuu110
sorry to interrupt you . I also have the same problem when run in Linux T^T
i just use the script as bootstrap.sh.
do your guys have any suggestions?

@sshhuu110
Copy link

@yyytq Now, I could able to run it on Linux OS and with only CPU.

What is the exact error are u facing?

@yyytq
Copy link
Author

yyytq commented Jan 26, 2016

@sshhuu110 just the first error you meet.

File "dataset/level1.py", line 16, in
from common import shuffle_in_unison_scary, logger, createDir, processImage
ImportError: No module named common

i have changed the script, but the error remain T^T

@luoyetx
Copy link
Owner

luoyetx commented Jan 26, 2016

@yyytq you may consider to modify PYTHONPATH environment. I don't know why you encounter this problem but I have no error on CentOS.

@sshhuu110
Copy link

@yyytq I did some thing like this
export PYTHONPATH=$HOME/dirWithScripts/:$PYTHONPATH
export PYTHONPATH=$HOME/common/:$PYTHONPATH

@sshhuu110
Copy link

@yytq Since these functions are in utils.py and utils.py is in common folder. I think we should also add common folder path to PYTHONPATH. This will solve your problem :)

@sshhuu110
Copy link

@yyytq

I think this must be dataset related problem, either you don't have data
sets or train and test data set may not be set to correct paths. Check once
again

On Tue, Jan 26, 2016 at 8:45 PM, yyytq [email protected] wrote:

@sshhuu110 https://github.com/sshhuu110
Thank you very much...but other problem occurs......😂😂

File "dataset/level1.py", line168, in
generate('dataset/train/trainImageList.txt', 'train',argument=True)
File"dataset/level1.py",line38,in generate
Image=cv2.imread(imagepath, cv2.CV_LOAD_IMAGE_GRAYSCALE)
AttributeError : 'module ' object has no attribute
'CV_LOAD_IMAGE_GRAYSCALE'

I tried to change cv2.CV_LOAD_IMAGE_GRAYSCALE to '0' or
cv2.IMREAD_GRAYSCALE but didn't work😭


Reply to this email directly or view it on GitHub
#1 (comment)
.

@yyytq
Copy link
Author

yyytq commented Jan 27, 2016

@sshhuu110 i'm sure the path is right.....

As i also encounter the error that can't found caffe .. i add the caffe path before 'import caffe' so that it can run
did you also encounter this problem?
if not…… I'll thinking if it is the problem of my software environment.....

@sshhuu110
Copy link

@yytq I have faced the "can't found caffe" problem also.

For that in level.py file in train folder you have to change cmd path to your caffe path like below

cmds = []
for t in models[level-1]:
    cmd = 'mkdir model/{0}_{1}'.format(level, t)
    os.system(cmd)
    cmd = '/home/username/Desktop/caffe-master/build/tools/caffe train --solver prototxt/{0}_{1}_solver.prototxt'.format(level, t)
    # w(os.system(cmd))
    cmds.append('/home/username/Desktop/caffe-master/build/tools/caffe train --solver prototxt/{0}_{1}_solver.prototxt'.format(level, t))

@yyytq
Copy link
Author

yyytq commented Jan 27, 2016

@sshhuu110 yeah . i have solved this by myself....
but still troubled by the 'CV_LOAD_IMAGE_GRAYSCALE' T^T
can you tell me that if you do some other changes except those mentioned below?
so that i can make my mental preparations beforehand ~~o(>_<)o ~~
or……if it is possible to send me the files that can run in Ubuntu directly?

@sshhuu110
Copy link

@yytq I had not got this "CV_LOAD_IMAGE_GRAYSCALE" problem

I did only the changes I have mentioned

attached level1 level2 level3 level.py files FYR

On Wed, Jan 27, 2016 at 3:56 PM, yyytq [email protected] wrote:

@sshhuu110 https://github.com/sshhuu110 yeah . i have solved this by
myself....
but still troubled by the 'CV_LOAD_IMAGE_GRAYSCALE' T^T
can you tell me that if you do some other changes except those mentioned
below?
so that i can make my mental preparations beforehand ~~o(>_<)o ~~
or……if it is possible to send me the files that can run in Ubuntu
directly?


Reply to this email directly or view it on GitHub
#1 (comment)
.

@yyytq
Copy link
Author

yyytq commented Jan 27, 2016

@sshhuu110 okay!thank you a lot !!

@pidanxhq
Copy link

@sshhuu110 hi ,I have faced the "can't found caffe" problem, and i changed code as below
cmd = '/home/data/caffe-master/tools/caffe train --solver prototxt/{0}_{1}solver.prototxt'.format(level, t)
# w(os.system(cmd))
cmds.append('/home/data/caffe-master/tools/caffe train --solver prototxt/{0}
{1}_solver.prototxt'.format(level, t))

it showed "sh: 1:"/home/data/caffe-master/tools/caffe: not found",do you know how to solve this problem

@huinsysu
Copy link

@yyytq hi,have you solved the problem "'module' object has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'"?I meet it too.Thanks a lot!

@huinsysu
Copy link

huinsysu commented Jan 27, 2018

@yyytq Hi,I have solved it! Just replace "CV_LOAD_IMAGE_GRAYSCALE" in the code with "IMREAD_GRAYSCALE".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants