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
When using Caffe::set_mode(Caffe::GPU), the program doesn't work correctly? #55
Comments
TestLiFT.prototxt like this: input: "data" |
Sorry, I can't replicate this and nothing else like it has been reported. The results are correct using the bundled |
Compilation fails for caffe opencl branch in CPU_ONLY mode issue #55
In order to get the probility output of softmax, I use the codes.
bash sh code:
GLOG_logtostderr=1 ../examples/TestLiFT.bin TestLiFT.prototxt lenet_iter_5000 10 "GPU" t10k-images-idx3-ubyte t10k-labels-idx1-ubyte
It can work correctly if i use Caffe::set_mode(Caffe::CPU);
E0124 16:31:13.968103 8064 TestLiFT.cpp:114] result size = 1 result channel = 10
E0124 16:31:13.968116 8064 TestLiFT.cpp:117] label = 5
E0124 16:31:13.968125 8064 TestLiFT.cpp:119] 1.53695e-05
E0124 16:31:13.968137 8064 TestLiFT.cpp:119] 4.50447e-06
E0124 16:31:13.968147 8064 TestLiFT.cpp:119] 4.77117e-05
E0124 16:31:13.968157 8064 TestLiFT.cpp:119] 0.000178817
E0124 16:31:13.968166 8064 TestLiFT.cpp:119] 1.75801e-05
E0124 16:31:13.968176 8064 TestLiFT.cpp:119] 0.958509
E0124 16:31:13.968185 8064 TestLiFT.cpp:119] 0.00345705
E0124 16:31:13.968196 8064 TestLiFT.cpp:119] 2.1301e-06
E0124 16:31:13.968205 8064 TestLiFT.cpp:119] 0.0376869
E0124 16:31:13.968215 8064 TestLiFT.cpp:119] 8.0598e-05
E0124 16:31:13.968225 8064 TestLiFT.cpp:121] ---------------------
E0124 16:31:13.969791 8064 TestLiFT.cpp:114] result size = 1 result channel = 10
E0124 16:31:13.969805 8064 TestLiFT.cpp:117] label = 9
E0124 16:31:13.969813 8064 TestLiFT.cpp:119] 0.0042518
E0124 16:31:13.969825 8064 TestLiFT.cpp:119] 0.000264884
E0124 16:31:13.969835 8064 TestLiFT.cpp:119] 0.000825241
E0124 16:31:13.969844 8064 TestLiFT.cpp:119] 0.0278211
E0124 16:31:13.969854 8064 TestLiFT.cpp:119] 0.0487807
E0124 16:31:13.969863 8064 TestLiFT.cpp:119] 0.0230153
E0124 16:31:13.969873 8064 TestLiFT.cpp:119] 0.000117688
E0124 16:31:13.969883 8064 TestLiFT.cpp:119] 0.209391
E0124 16:31:13.969893 8064 TestLiFT.cpp:119] 0.150328
E0124 16:31:13.969902 8064 TestLiFT.cpp:119] 0.535204
E0124 16:31:13.969913 8064 TestLiFT.cpp:121] ---------------------
if not, the output of softmax will be the same for different image
E0124 16:32:27.603427 8087 TestLiFT.cpp:114] result size = 1 result channel = 10
E0124 16:32:27.603441 8087 TestLiFT.cpp:117] label = 5
E0124 16:32:27.604112 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604125 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604135 8087 TestLiFT.cpp:119] 1
E0124 16:32:27.604145 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604154 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604163 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604173 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604182 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604192 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604202 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.604212 8087 TestLiFT.cpp:121] ---------------------
E0124 16:32:27.604346 8087 TestLiFT.cpp:114] result size = 1 result channel = 10
E0124 16:32:27.604360 8087 TestLiFT.cpp:117] label = 9
E0124 16:32:27.605039 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605062 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605077 8087 TestLiFT.cpp:119] 1
E0124 16:32:27.605087 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605097 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605106 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605115 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605125 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605134 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605144 8087 TestLiFT.cpp:119] 0
E0124 16:32:27.605154 8087 TestLiFT.cpp:121] ---------------------
TestLiFT.cc
// Copyright 2013 Yangqing Jia
//
// This is a simple script that allows one to quickly test a network whose
// structure is specified by text format protocol buffers, and whose parameter
// are loaded from a pre-trained network.
// Usage:
// test_net net_proto pretrained_net_proto iterations [CPU/GPU]
include <cuda_runtime.h>
//#include
//#include
include
include "caffe/caffe.hpp"
include
include
include
using namespace caffe;
uint32_t swap_endian( uint32_t val )
{
val = ((val << 8) & 0xFF00FF00 ) | ((val >> 8) & 0xFF00FF );
return (val << 16) | (val >> 16);
}
int main(int argc, char** argv) {
if (argc < 7) {
LOG(ERROR) << "TestLiFT net_proto pretrained_net_proto iterations [CPU/GPU] image-data lable-data";
return 0;
}
}
The text was updated successfully, but these errors were encountered: