配置和运行 MatchNet CVPR 2015 MatchNet: Unifying Feature and Metric Learning for Patch-Based Matching
2017-01-20 17:06
465 查看
配置和运行 MatchNet CVPR 2015
GitHub: https://github.com/hanxf/matchnet
最近一个同学在配置,测试这个网络,但是总是遇到各种问题. 我也尝试了一下,结果也是一堆问题. 这里记录一下.
问题1. ImportError: No module named leveldb
wangxiao@AHU:~/Downloads/matchnet-master$ ./run_gen_data.sh
Traceback (most recent call last):
File "generate_patch_db.py", line 19, in <module>
import leveldb, numpy as np, skimage
ImportError: No module named leveldb
Traceback (most recent call last):
File "generate_patch_db.py", line 19, in <module>
import leveldb, numpy as np, skimage
ImportError: No module named leveldb
Traceback (most recent call last):
File "generate_patch_db.py", line 19, in <module>
import leveldb, numpy as np, skimage
ImportError: No module named leveldb
可以看到, 总是提示没有这个 leveldb . Ok, 没有就安装就是了:
wangxiao@AHU:~$ pip install leveldb
Collecting leveldb
Downloading leveldb-0.194.tar.gz (228kB)
100% |████████████████████████████████| 235kB 13kB/s
Building wheels for collected packages: leveldb
Running setup.py bdist_wheel for leveldb ... done
Stored in directory: /home/wangxiao/.cache/pip/wheels/36/8f/73/51df0d55dae7b540bc560eb223fff5f909033954552eae8d15
Successfully built leveldb
Installing collected packages: leveldb
Successfully installed leveldb-0.194
然后,这个问题就解决了.
但是, 新出了一个问题2: No module named caffe.proto
wangxiao@AHU:~/Downloads/matchnet-master$ ./run_gen_data.sh
Traceback (most recent call last):
File "generate_patch_db.py", line 21, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Traceback (most recent call last):
File "generate_patch_db.py", line 21, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Traceback (most recent call last):
File "generate_patch_db.py", line 21, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Ok, 感觉其实, 这个工程代码没有提示 caffe 该放在哪个文件夹, 是麻烦的问题所在. 那么, 现在只有猜测了.
我们在编译 pycaffe 的时候, 终端有提示我们 caffe.proto 的位置 :
wangxiao@AHU:~/Downloads/matchnet-master/caffe-master$ make pycaffe
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
touch python/caffe/proto/__init__.py
PROTOC (python) src/caffe/proto/caffe.proto
wangxiao@AHU:~/Downloads/matchnet-master/caffe-master$
---- to be continued ...
终于找到原因了: 是 caffe 文件夹放置的路径不对 !
我之前一直将 caffe 文件夹放置在下载的 match net 文件夹下, 如下图所示:
但是, 其实这样子是不对的. 应该将下载的代码放到 caffe 文件中, 或者你也可以将 caffe 中的文件 拷贝到 matchnet 文件中.
然后运行
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=/home/wangxiao/Documents/Siamese_Matching/matchnet-master/python:$PYTHONPATH
$ ./run_eval.sh liberty notredame "--use_gpu --gpu_id=0"
Reference:
@inproceedings{matchnet_cvpr_15,
GitHub: https://github.com/hanxf/matchnet
最近一个同学在配置,测试这个网络,但是总是遇到各种问题. 我也尝试了一下,结果也是一堆问题. 这里记录一下.
问题1. ImportError: No module named leveldb
wangxiao@AHU:~/Downloads/matchnet-master$ ./run_gen_data.sh
Traceback (most recent call last):
File "generate_patch_db.py", line 19, in <module>
import leveldb, numpy as np, skimage
ImportError: No module named leveldb
Traceback (most recent call last):
File "generate_patch_db.py", line 19, in <module>
import leveldb, numpy as np, skimage
ImportError: No module named leveldb
Traceback (most recent call last):
File "generate_patch_db.py", line 19, in <module>
import leveldb, numpy as np, skimage
ImportError: No module named leveldb
可以看到, 总是提示没有这个 leveldb . Ok, 没有就安装就是了:
wangxiao@AHU:~$ pip install leveldb
Collecting leveldb
Downloading leveldb-0.194.tar.gz (228kB)
100% |████████████████████████████████| 235kB 13kB/s
Building wheels for collected packages: leveldb
Running setup.py bdist_wheel for leveldb ... done
Stored in directory: /home/wangxiao/.cache/pip/wheels/36/8f/73/51df0d55dae7b540bc560eb223fff5f909033954552eae8d15
Successfully built leveldb
Installing collected packages: leveldb
Successfully installed leveldb-0.194
然后,这个问题就解决了.
但是, 新出了一个问题2: No module named caffe.proto
wangxiao@AHU:~/Downloads/matchnet-master$ ./run_gen_data.sh
Traceback (most recent call last):
File "generate_patch_db.py", line 21, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Traceback (most recent call last):
File "generate_patch_db.py", line 21, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Traceback (most recent call last):
File "generate_patch_db.py", line 21, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Ok, 感觉其实, 这个工程代码没有提示 caffe 该放在哪个文件夹, 是麻烦的问题所在. 那么, 现在只有猜测了.
我们在编译 pycaffe 的时候, 终端有提示我们 caffe.proto 的位置 :
wangxiao@AHU:~/Downloads/matchnet-master/caffe-master$ make pycaffe
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
touch python/caffe/proto/__init__.py
PROTOC (python) src/caffe/proto/caffe.proto
wangxiao@AHU:~/Downloads/matchnet-master/caffe-master$
---- to be continued ...
终于找到原因了: 是 caffe 文件夹放置的路径不对 !
我之前一直将 caffe 文件夹放置在下载的 match net 文件夹下, 如下图所示:
但是, 其实这样子是不对的. 应该将下载的代码放到 caffe 文件中, 或者你也可以将 caffe 中的文件 拷贝到 matchnet 文件中.
然后运行
./run_gen_data.sh 就可以开始处理数据,然后运行了.
Acturally, we also need to export path to the environments. like followings:
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=/home/wangxiao/Documents/Siamese_Matching/matchnet-master/python:$PYTHONPATH
with pre-processed data, and we can now test this code with evaluate scripts.
$ ./run_eval.sh liberty notredame "--use_gpu --gpu_id=0"
Reference:
@inproceedings{matchnet_cvpr_15,
Author = {Han, Xufeng and Leung, Thomas and Jia, Yangqing and Sukthankar, Rahul and Berg, Alexander. C.}, Booktitle = {CVPR}, Title = {MatchNet: Unifying Feature and Metric Learning for Patch-Based Matching}, Year = {2015} }
Compared with only test this code, we also want to know how to train/finetune the network on our own data ? But, how ???
相关文章推荐
- 论文笔记之:MatchNet: Unifying Feature and Metric Learning for Patch-Based Matching
- MatchNet: Unifying Feature and Metric Learning for Patch-Based Matching
- 001: MatchNet: Unifying Feature and Metric Learning for Patch-Based Matching
- 论文笔记:MatchNet: Unifying Feature and Metric Learning for Patch-Based Matching
- 论文阅读:CVPR 2015 FaceNet: A Unified Embedding for Face Recognition and Clustering
- CVPR2017: Learning Deep Context-aware Features over Body and Latent Parts for
- 【论文阅读笔记】CVPR2015-Long-term Recurrent Convolutional Networks for Visual Recognition and Description
- 论文阅读:《Structured Feature Learning for Pose Estimation》CVPR 2016
- Matlab Codes and Datasets for Feature Learning
- QT环境配置及运行 - For Windows and S60
- PS:Hypercolumns for Object Segmentation and Fine-Grained Localization__CVPR2015
- A Discriminative Feature Learning Approach for Deep Face Recognition 配置 caffe-face 并训练数据
- 论文笔记之---Joint Detection and Identification Feature Learning for Person Search
- Matlab Codes and Datasets for Feature Learning
- Matlab Codes and Datasets for Feature Learning(转)
- BassNet:Band-Adaptive Spectral-Spatial Feature Learning Neural Network for Hyperspectral Image ...
- CVPR2015:An Improved Deep Learning Architecture for Person Re-Identificaton
- Adaptive Deconvolutional Networks for Mid and High Level Feature Learning(阅读)
- 特征学习的matlab代码和数据集 Matlab Codes and Datasets for Feature Learning
- [CVPR2016]Learning Deep Feature Representations with Domain Guided Dropout for Person Re-id