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

how to build this #3

Closed
GuitarZhang opened this issue Apr 28, 2016 · 9 comments
Closed

how to build this #3

GuitarZhang opened this issue Apr 28, 2016 · 9 comments

Comments

@GuitarZhang
Copy link

Hi, I don't know how to build this layer, which path in caffe i put this code in.Can you give the step for add this layer?
Thanks!

@luhaofang
Copy link
Owner

Hi,
Firstly you should makesure your caffe is built for Python layers. If not open "Makefile.config" in caffe root and uncomment the line “WITH_PYTHON_LAYER := 1”.Rebuild caffe.

Go to tripletloss root path. Add tripletloss root path to train.py.

Change the configs in config.py then caffe can create the network.

Note :Training a network you should read the code first.

@GuitarZhang
Copy link
Author

When I run train.py , an error occurred, " No module named tripletloss.datalayer"。
You said "Add tripletloss root path to train.py", I only changed pathes in main function, is it right?

@GuitarZhang
Copy link
Author

" No module named tripletloss.datalayer"这个错误解决了,把module设置为datalayer就好了。
出现了另外一个问题,“AttributeError: 'DataLayer' object has no attribute 'param_str_'”,我查了caffe的源码也没有找到这个param_str_,这是哪里错了呢?

@luhaofang
Copy link
Owner

你的python路径没有找到,这几个datalayer都是python写的,需要添加工程的根路径到你的python中

@GuitarZhang
Copy link
Author

不知道楼主的比对结果是多少呢?我看tripletselectlayer里面是把if an > ap:记下来了,应该是ap>an吧?

@luhaofang
Copy link
Owner

luhaofang commented May 4, 2016

semi-hard的筛选请参见paper的内容。
个人感觉这里应该有一些trick,似乎可以通过设置区间参数来调整样本的筛选,本人也做了些调整,但目前并未发现选择 an > ap + beta 区间,对结果产生的差异性表现

@GuitarZhang
Copy link
Author

恩,恩论文中看到了。tripletselectlayer这一层需要backward吗?总感觉不backward,loss像传不到前面似的。

@GuitarZhang
Copy link
Author

我运行的时候所有的都显示not need backward computation,不知哪里出了问题?
tripletloss does not need backward computation.
I0504 18:03:40.812458 66083 net.cpp:228] triplet_select does not need backward computation.
I0504 18:03:40.812466 66083 net.cpp:228] norm2 does not need backward computation.
I0504 18:03:40.812474 66083 net.cpp:228] drop8 does not need backward computation.
I0504 18:03:40.812482 66083 net.cpp:228] relu8 does not need backward computation.
I0504 18:03:40.812489 66083 net.cpp:228] fc9 does not need backward computation.
I0504 18:03:40.812497 66083 net.cpp:228] drop7 does not need backward computation.
I0504 18:03:40.812505 66083 net.cpp:228] relu7 does not need backward computation.
I0504 18:03:40.812512 66083 net.cpp:228] fc7 does not need backward computation.
I0504 18:03:40.812520 66083 net.cpp:228] drop6 does not need backward computation.
I0504 18:03:40.812528 66083 net.cpp:228] relu6 does not need backward computation.
I0504 18:03:40.812536 66083 net.cpp:228] fc6 does not need backward computation.
I0504 18:03:40.812544 66083 net.cpp:228] pool5 does not need backward computation.
I0504 18:03:40.812557 66083 net.cpp:228] relu5_3 does not need backward computation.
I0504 18:03:40.812566 66083 net.cpp:228] conv5_3 does not need backward computation.
I0504 18:03:40.812573 66083 net.cpp:228] relu5_2 does not need backward computation.
I0504 18:03:40.812582 66083 net.cpp:228] conv5_2 does not need backward computation.
I0504 18:03:40.812590 66083 net.cpp:228] relu5_1 does not need backward computation.
I0504 18:03:40.812597 66083 net.cpp:228] conv5_1 does not need backward computation.
I0504 18:03:40.812605 66083 net.cpp:228] pool4 does not need backward computation.
I0504 18:03:40.812613 66083 net.cpp:228] relu4_3 does not need backward computation.
I0504 18:03:40.812621 66083 net.cpp:228] conv4_3 does not need backward computation.
I0504 18:03:40.812629 66083 net.cpp:228] relu4_2 does not need backward computation.
I0504 18:03:40.812638 66083 net.cpp:228] conv4_2 does not need backward computation.
I0504 18:03:40.812662 66083 net.cpp:228] relu4_1 does not need backward computation.
I0504 18:03:40.812672 66083 net.cpp:228] conv4_1 does not need backward computation.
I0504 18:03:40.812680 66083 net.cpp:228] pool3 does not need backward computation.
I0504 18:03:40.812688 66083 net.cpp:228] relu3_3 does not need backward computation

@louielu1027
Copy link

@GuitarZhang 您好,我也遇到了您的问题,AttributeError: 'DataLayer' object has no attribute 'param_str_;请问您如何解决这个问题的?具体过程有吗?

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

3 participants