caffe里的clip gradientclipinf是什么意思思

如何用caffe解决回归问题?
看了几个caffe的例子,都是做的分类问题,想问一下,caffe框架能不能直接解决回归问题呢?麻烦了解的人士给予解答
按时间排序
看看这个,可能有帮助但是caffe对这个做的不够好,同样的网络结构,结果不如这里的
刚刚在读caffe的API文档,看到了就顺便答一下,在此This can be used for least-squares regression tasks. An
input to a
exactly formulates a linear least squares regression problem. With non-zero weight decay the problem becomes one of ridge regression – see src/caffe/test/test_sgd_solver.cpp for a concrete example wherein we check that the gradients computed for a
with exactly this structure match hand-computed gradient formulas for ridge regression.翻译一下就是说,一个全连接层接一个欧氏距离损失层就可以完成一个Linear Regression的问题。如果对应的weight decay是非零的,就变成了ridge regression问题,貌似是岭回归?我不太懂……当然,还有一句:Note: , and SGD in general, is certainly not the best way to solve linear least squares problems! We use it only as an instructive example.也就是说,caffe不是为了干这事而生的,regression有更好的方法,更好的实现。所以如果您问能不能,答案是肯定能;好不好?说不好。
今天看到一个用caffe做的逻辑回归,可以参考。name: "LogisticRegression"
name: "mydata"
type: DATA
top: "data"
top: "label"
data_param {
source: "input_leveldb"
batch_size: 128
name: "ip1"
type: INNER_PRODUCT
bottom: "data"
top: "ip1"
inner_product_param {
num_output: 2
name: "loss"
type: SOFTMAX_LOSS
bottom: "ip"
bottom: "label"
top: "loss"
可以,最后一层用Euclidean Loss,标定给具体的坐标点即可
可以做回归,数据格式用HDF5就好,损失函数选择平方误差即可
谢邀。caffe能做regression,修改最后一层loss层。可以参考下这个人脸关键点检测github项目。
谢邀。caffe只是一个framework,很显然是可以做回归的。回归和分类最大的不同在于最后的loss层,所以可以在已有的的例子的基础上进行相应的修改。
谢邀。确定的说,caffe是可以做回归的。因为神经网络本质上是一个非常复杂的非线性函数,合理设计其网络结构,它的输出值的范围是可以覆盖你的回归目标的范围的。具体例子,可以参考唐晓鸥团队利用卷积神经网络做的人脸关键点定为,这是利用神经网络做回归的一个典型例子。
谢邀。。。然而我只是个电子工程专业转来的战0渣。而且对回归的了解仅限于高中课本。。。。。我感觉题主可以想想cnn能不能用于回归,caffe就是个cnn的model吖。另外也可以考虑把中间层提取的特征拿出来用,不知道可以用上不,
已有帐号?
社交帐号登录
无法登录?
社交帐号登录1459人阅读
caffe(1)
ImportError: No module named skimage
【问题1】对于双显卡的笔记本而已,通过*.run方式安装CUDA时,重启后会黑屏出现无法进入桌面,只能进入tty
解决方法:采用*.deb方式来安装CUDA,不需要另外安装NVIDIA驱动(CUDA-7.0自带的就是最新的驱动),同时也不需关闭lightdm服务进入tty终端来安装。
在CUDA官网&/cuda-downloads下载deb离线包安装即可。
【问题2】error: ‘CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING’ was not declared in this scope(安装cuDNN时,make 未声明错误)
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
from ./include/caffe/common.hpp:19,
from ./include/caffe/util/math_functions.hpp:9,
from src/caffe/util/im2col.cpp:6:
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::createPoolingDesc(cudnnPoolingStruct**, caffe::PoolingParameter_PoolMethod, cudnnPoolingMode_t*, int, int, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:117:13: error: ‘CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING’ was not declared in this scope
*mode = CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING;
Makefile:510: recipe for target '.build_release/src/caffe/util/im2col.o' failed
make: *** [.build_release/src/caffe/util/im2col.o] Error 1
make: *** Waiting for unfinished jobs....
解决方法:原因是之前用cuDNN版本cudnn-6.5-linux-x64-R2-rc1.tgz过低,不适合当前的caffe版本,在cuDNN官网/cuDNN注册下载目前最新的cuDNN版本cudnn-6.5-linux-x64-v2.tgz即可。
【问题3】Check failed: status == CUDNN_STATUS_SUCCESS (6 vs. 0) &CUDNN_STATUS_ARCH_MISMATCH (make runtest 的check错误)
F:55.23 cudnn_softmax_layer.cpp:19] Check failed: status == CUDNN_STATUS_SUCCESS (6 vs. 0)
CUDNN_STATUS_ARCH_MISMATCH
*** Check failure stack trace: ***
0x7f13a97c7a0d
google::LogMessage::Fail()
0x7f13a97c98c0
google::LogMessage::SendToLog()
0x7f13a97c75d2
google::LogMessage::Flush()
0x7f13a97ca2de
google::LogMessageFatal::~LogMessageFatal()
0x7f13a63347a6
caffe::CuDNNSoftmaxLayer&&::LayerSetUp()
0x7f13a633afad
caffe::SoftmaxWithLossLayer&&::LayerSetUp()
caffe::GradientChecker&&::CheckGradientExhaustive()
caffe::SoftmaxWithLossLayerTest_TestGradientUnnormalized_Test&&::TestBody()
testing::internal::HandleExceptionsInMethodIfSupported&&()
testing::Test::Run()
testing::TestInfo::Run()
testing::TestCase::Run()
testing::internal::UnitTestImpl::RunAllTests()
testing::UnitTest::Run()
0x7f13a5654a40
Makefile:465: recipe for target 'runtest' failed
make: *** [runtest] Aborted (core dumped)解决方法:在cuDNN安装包中的INSTALL.txt可以看到
PREREQUISITES
CUDA 6.5 and a GPU of compute capability 3.0 or higher are required.
意思是GPU的加速能力不够,CUDNN只支持CUDA Capability 3.0以上的GPU加速,而我的笔记本显卡GT635M才2.1的加速能力,在其他3.0以上的显卡运行正常,因此选择不启用cuDNN加速,在Makefile.config中注释USE_CUDNN行。
【问题4】/usr/bin/ld: cannot find -lopenblas
解决方法:
&一般出现这种错误有以下几种原因:
1.系统缺乏对应的库文件;
2.版本不对应;
3.库文件的链接错误;
4.库文件路径设置问题。
对应第一第二种情况,可以通过安装lib来解决,ubuntu大多数可以直接通过apt-get来安装:
apt-get install libxxx-dev
&一般遇到这种问题笔者第一时间也是会去检查是否已安装该lib或者是否已选择正确版本,
如果还是不能解决问题,那么,引起错误的原因不是链接错误就是库文件路径问题。
&通过find或者locate指令定位到链接文件,查看链接文件是否正确的指向了我们希望的lib,如果不是,用 ln -sf */libxxx.so.x */libxxx.so 指令修改它。
&如果是库文件路径引发的问题,可以到/etc/ld.so.conf.d目录下,修改其中任意一份conf文件,(可以自建conf,以方便识别)将lib所在目录写进去,然后在终端输入 ldconfig 更新缓存。      
这里,就直接修改Makefile中BLAS_INCLUDE和BLAS_LIB
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
BLAS_INCLUDE := /opt/OpenBLAS/include
BLAS_LIB := /opt/OpenBLAS/lib
【问题5】g++版本过高
error: kernel launches from templates are not allowed in system files 1
error detected in the compilation of &/tmp/tmpxft_00000-10_math_functions.cpp4.ii&.
解决方法:
在Ubuntu14.04中会出现g++版本过高的问题,Ubuntu15.04则正常
sudo apt-get install gcc-4.6 g++-4.6 gcc-4.6-multilib g++-4.6-multilib
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
修改makefile,指定g++版本
CXX := /usr/bin/g++-4.6
./create_mnist.sh: 16: ./create_mnist.sh: build/examples/mnist/convert_mnist_data.bin: not found
解决方法:
新版caffe都需要从根目录上执行,不然可能会遇到这个错误
默认切换到了该工作目录 home/username/caffe-master,测试Caffe是否工作正常
$ sh data/mnist/get_mnist.sh
% 数据预处理
$ sh examples/mnist/create_mnist.sh % 生成mnist-train-lmdb 和 mnist-train-lmdb文件夹,这里包含了lmdb格式的数据集
$ sh examples/mnist/train_lenet.sh % 训练mnist
在用pycaffe在做可视化时,出现如下错误
ImportError: No module named skimage解决方法:
After installing cython , and then scikit-image.
pip install cython
pip install scikit-image
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:3307次
排名:千里之外&&国之画&&&& &&&&&&
&& &&&&&&&&&&&&&&&&&&
鲁ICP备号-4
打开技术之扣,分享程序人生!

我要回帖

更多关于 clipinf是什么意思 的文章

 

随机推荐