craymichael / CNN_LCD

CNNs for Loop-Closure Detection on the Oxford New College and City Centre Datasets
GNU General Public License v3.0
58 stars 14 forks source link

some problems #2

Closed Vslamer closed 5 years ago

Vslamer commented 5 years ago

I am a beginner . How to do solve this? I try to run this program. 1.ImportError: No module named overfeat I install overfeat according to the official website.It shows that install ok.Is this difffrent to the official? tar xvf overfeat-vXX.tgz ./download_weights.py sudo apt-get install build-essential gcc g++ gfortran git libgfortran3 cd /tmp git clone https://github.com/xianyi/OpenBLAS.git cd OpenBLAS make NO_AFFINITY=1 USE_OPENMP=1 sudo make install 2.run the code "python setup.py install" UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running install running build running build_ext building 'overfeat' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I../../src -I/home/cy/anaconda3/envs/tensorflow27/lib/python2.7/site-packages/numpy/core/include -I/home/cy/anaconda3/envs/tensorflow27/include/python2.7 -c overfeatmodule.cpp -o build/temp.linux-x86_64-2.7/overfeatmodule.o -fopenmp cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] In file included from ../../src/THTensor.hpp:5:0, from ../../src/overfeat.hpp:4, from overfeatmodule.cpp:3: ../../src/TH/TH.h:4:23: fatal error: THGeneral.h: No such file or directory

include "THGeneral.h"

                   ^

compilation terminated. error: command 'gcc' failed with exit status 1

Vslamer commented 5 years ago

(tensorflow36) cy@pc:~/loopclosure/CNN_LCD-master$ python cnn_lcd.py Python 3 detected: OverFeat unavailable. 2018-12-29 17:15:29.540218: F tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine. Aborted (core dumped)

Vslamer commented 5 years ago

run'python setup.py install'

(tensorflow36) cy@pc:~/loopclosure/CNN_LCD-master/overfeat/API/python$ python setup.py install /home/cy/anaconda3/envs/tensorflow36/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running install running build running build_ext building 'overfeat' extension gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I../../src -I/home/cy/.local/lib/python3.6/site-packages/numpy/core/include -I/home/cy/anaconda3/envs/tensorflow36/include/python3.6m -c overfeatmodule.cpp -o build/temp.linux-x86_64-3.6/overfeatmodule.o -fopenmp cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] In file included from ../../src/THTensor.hpp:5:0, from ../../src/overfeat.hpp:4, from overfeatmodule.cpp:3: ../../src/TH/TH.h:4:23: fatal error: THGeneral.h: No such file or directory

include "THGeneral.h"

                   ^

compilation terminated. error: command 'gcc' failed with exit status 1

Vslamer commented 5 years ago

install OpenBLAS

make -j 2 -f Makefile.install install make[1]: Entering directory `/tmp/OpenBLAS' Generating openblas_config.h in /path/to/your/installation/include Generating f77blas.h in /path/to/your/installation/include Generating cblas.h in /path/to/your/installation/include Copying LAPACKE header files to /path/to/your/installation/include Copying the static library to /path/to/your/installation/lib Copying the shared library to /path/to/your/installation/lib Generating openblas.pc in /path/to/your/installation/lib/pkgconfig Generating OpenBLASConfig.cmake in /path/to/your/installation/lib/cmake/openblas Generating OpenBLASConfigVersion.cmake in /path/to/your/installation/lib/cmake/openblas Install OK!

Vslamer commented 5 years ago

How to do solve it ,please help me .thanks.

craymichael commented 5 years ago

Python 3 detected: OverFeat unavailable. You need to run the code with OverFeat installed using Python 2.7. If you are not trying to use OverFeat, you will need to clone the TensorFlow slim models repo locally.

python setup.py install Ensure you are using Python 2.7 again. The last time I used OverFeat I was only able to run using Python 2.7 and I believe that is the only supported version of Python for the API.

Let me know if this resolves your issues. Keep in mind the open OverFeat issue.

Vslamer commented 5 years ago

Python 3 detected: OverFeat unavailable. You need to run the code with OverFeat installed using Python 2.7. If you are not trying to use OverFeat, you will need to clone the TensorFlow slim models repo locally.

python setup.py install Ensure you are using Python 2.7 again. The last time I used OverFeat I was only able to run using Python 2.7 and I believe that is the only supported version of Python for the API.

Let me know if this resolves your issues. Keep in mind the open OverFeat issue.

Thanks very much. I run the code with OverFeat installed using Python 2.7. That remind me using Python 3. So I install Python 3.I also git clone the TensorFlow slim models repo locally.Do you mean I can run this program without overfeat?

Vslamer commented 5 years ago

Install overfeat bug: cy@pc:~/loopclosure/CNN_LCD-master/overfeat$ ./bin/linux_64/overfeat -n 3 samples/bee.jpg sh: 1: convert: not found /home/cy/loopclosure/CNN_LCD-master/overfeat/bin/linux_64/overfeatcmd: error while loading shared libraries: libopenblas.so.0: cannot open shared object file: No such file or directory

craymichael commented 5 years ago

Yes you can run this without overfeat. Python 3 allows for use of TF slim models (inception, resnet, etc.), and Python 2 allows for use of overfeat. See this answer to resolve your issue.

Vslamer commented 5 years ago

Yes you can run this without overfeat. Python 3 allows for use of TF slim models (inception, resnet, etc.), and Python 2 allows for use of overfeat. See this answer to resolve your issue.

Thank you very much. I solve the overfeat bug. Do that mean overfeat install ok? But I run "python cnn_lcd.py", it also have the same bug.How to run this program without overfeat in python3? I use anaconda3 install the virtual environment python3.6 and python2.7. in python3.6 Python 3 detected: OverFeat unavailable. 2019-01-02 11:10:06.715117: F tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine. Aborted (core dumped)

in python2.7 (tensorflow27) cy@pc:~/loopclosure/CNN_LCD-master$ python cnn_lcd.py Python 2 detected: OverFeat-only mode. Traceback (most recent call last): File "cnn_lcd.py", line 32, in <module> from cnn_models import get_model_features, is_valid_model File "/home/cy/loopclosure/CNN_LCD-master/cnn_models.py", line 31, in <module> import overfeat ImportError: No module named overfeat Then I install overfeat. test the example (tensorflow27) cy@pc:~/loopclosure/CNN_LCD-master/overfeat$ ./bin/linux_64/overfeat -n 3 samples/bee.jpg OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance. bee 0.861863 leaf beetle, chrysomelid 0.0543098 fly 0.0306221 install python api `(tensorflow27) cy@pc:~/loopclosure/CNN_LCD-master/overfeat/API/python$ python setup.py install /home/cy/anaconda3/envs/tensorflow27/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running install running build running build_ext building 'overfeat' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I../../src -I/home/cy/anaconda3/envs/tensorflow27/lib/python2.7/site-packages/numpy/core/include -I/home/cy/anaconda3/envs/tensorflow27/include/python2.7 -c overfeatmodule.cpp -o build/temp.linux-x86_64-2.7/overfeatmodule.o -fopenmp cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] In file included from ../../src/THTensor.hpp:5:0, from ../../src/overfeat.hpp:4, from overfeatmodule.cpp:3: ../../src/TH/TH.h:4:23: fatal error: THGeneral.h: No such file or directory

include "THGeneral.h"

                   ^

compilation terminated. error: command 'gcc' failed with exit status 1 ` Thanks again.

craymichael commented 5 years ago

With Python 3.6, you seem to have a problem with the installed version of TensorFlow - apparently, the one installed with pip is pre-compiled with AVX instructions which your CPU does not support (see this issue). You should either build TensorFlow from source or retry installing from conda, see this page. Additionally, I have seen posts that say downgrading TensorFlow (e.g. to 1.5) may fix this issue for Python 3.6. This is a conda-specific issue which apparently occurs only with Python 3 and not 2.7.

Regarding the OverFeat issue, you may need to ask sermanet how to proceed. Off-hand, it appears that "THGeneral.h" may be named incorrectly. Try renaming "src/TH/THGeneral.h.in" to "src/TH/THGeneral.h"

Vslamer commented 5 years ago

With Python 3.6, you seem to have a problem with the installed version of TensorFlow - apparently, the one installed with pip is pre-compiled with AVX instructions which your CPU does not support (see this issue). You should either build TensorFlow from source or retry installing from conda, see this page. Additionally, I have seen posts that say downgrading TensorFlow (e.g. to 1.5) may fix this issue for Python 3.6. This is a conda-specific issue which apparently occurs only with Python 3 and not 2.7.

Regarding the OverFeat issue, you may need to ask sermanet how to proceed. Off-hand, it appears that "THGeneral.h" may be named incorrectly. Try renaming "src/TH/THGeneral.h.in" to "src/TH/THGeneral.h"

Dear craymichael : Thank you very very much. I don't know how to do without your help. I soLve these problems as you replied. But it has the same issues in ubuntu14.04. Finally,I try to run this program in windows by anaconda according to the tutorial.The tensorflow has no problem. And I run the code ok on a remote server by winscp. I am so happy. Because I spend so much time to run code.Thanks again. And I want to ask you some things about CNN Loop Closure Detection. Could you give me some advices? Have you ever published a paper on CNN Loop Closure Detection? My research is visual SLAM. And I want to write a paper aboult deep learing apply Loop Closure Detection. Do you think is it ok to improve on this repository? If I can improve it, What can be improved? I find its precision is low. For example, in modle inception_v2, its precision is 0.03. Maybe I can improve that. Best wishes

Vslamer commented 5 years ago

Also,for below three positional arguments, I don't know what to write in "WEIGHTS_DIR","WEIGHTS_BASE","LAYER " for python3. What are these three parameters used for? --weights_dir WEIGHTS_DIR Weights directory. --weights_base WEIGHTS_BASE Basename of weights file. --layer LAYER Layer number to extract features from.

Thank you very much for your reply these days

craymichael commented 5 years ago

You are most welcome, I'm glad things are finally working for you.

Have you ever published a paper on CNN Loop Closure Detection?

I have not published specifically on loop-closure detection, but have recently had a paper accepted on autonomous driving.

Do you think is it ok to improve on this repository? If I can improve it, What can be improved?

Definitely, the current method does not work very well. I would definitely give the original paper, "Loop closure detection for visual SLAM systems using convolutional neural network," a read and those that cite it, such as the papers listed here. The similarity metric is quite simple (and unsupervised) and could definitely be improved.

Regarding the program arguments, here is some more information:

I'm closing the issue for now as the original problem has been resolved, but feel free to continue commenting.