unknown command line flag 'logtostderr'

2019-09-01 15:51发布

I am running this SIFT program at this site: https://github.com/sanchom/sjm

All the stuffs go well until I run my program:

$ python extract_caltech.py --dataset_path=[path_to_your_101_Categories_directory] \
--process_limit [num_processes_to_spawn] --sift_normalization_threshold 2.0 -- sift_discard_unnormalized \
--sift_grid_type FIXED_3X3 --sift_first_level_smoothing 0.66 --sift_fast --sift_multiscale \
--features_directory [path_for_extracted_features]

In the output, I see this line thousands of times:

ERROR: unknown command line flag 'logtostderr'

I have checked for some solutions as suggested here:

https://code.google.com/p/google-glog/issues/detail?id=17&q=glog%20gflagsBut

What I did is to add GLOG_logtostderr=1 before I run my program:

GLOG_logtostderr=1 ./my_application

But it did not work our for me.

As far as I know, its the problem related to linking between Gflags and Glog. But i haven't got any ideas on how to solve it yet. Please help. Thanks!

2条回答
相关推荐>>
2楼-- · 2019-09-01 16:23

$GLOG_logtostderr=1 isn't doing what you expect. $name means "replace this with the value of the environment variable name". But you want to define a new variable. Use this instead:

GLOG_logtostderr=1 ./my_application

(i.e. omit the $).

查看更多
Bombasti
3楼-- · 2019-09-01 16:26

I have solved my problem. Its because IIRC macports' glog is not built with gflags but the python script sets --logtostderr. So just remove --logtostderr from the python script by running the script:

find . -name '*.py' -exec perl -i -p -e 's/--logtostderr//' {} \;

To find out if you're affected, run

ldd libglog.so

and check if libgflags is in the output.

The solution is suggested from this site:

https://code.google.com/p/google-glog/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&groupby=&sort=&id=206

查看更多
登录 后发表回答