author | Yangqing Jia <jiayq84@gmail.com> | |
Wed, 30 Oct 2013 18:20:51 +0000 (11:20 -0700) | ||
committer | Yangqing Jia <jiayq84@gmail.com> | |
Wed, 30 Oct 2013 18:20:51 +0000 (11:20 -0700) |
examples/demo_mnist.cpp | patch | blob | history | |
src/caffe/common.cpp | patch | blob | history |
index 8459180bc90c02e3bce6b6fd2c19dc5c3de81065..11d3fc518b999e270f6b2a19252da45a72000a75 100644 (file)
--- a/examples/demo_mnist.cpp
+++ b/examples/demo_mnist.cpp
SolverParameter solver_param;
// Solver Parameters are hard-coded in this case, but you can write a
// SolverParameter protocol buffer to specify all these values.
- solver_param.set_base_lr(0.001);
+ solver_param.set_base_lr(0.01);
solver_param.set_display(100);
solver_param.set_max_iter(5000);
solver_param.set_lr_policy("inv");
diff --git a/src/caffe/common.cpp b/src/caffe/common.cpp
index 1fce86a2d17a1fe174bb948ba92ad50fc2b2257f..46d21c9c390d460029e43663f0f0284eecfb1914 100644 (file)
--- a/src/caffe/common.cpp
+++ b/src/caffe/common.cpp
}
Caffe::~Caffe() {
- if (!cublas_handle_) CUBLAS_CHECK(cublasDestroy(cublas_handle_));
- if (!curand_generator_) {
+ if (cublas_handle_) CUBLAS_CHECK(cublasDestroy(cublas_handle_));
+ if (curand_generator_) {
CURAND_CHECK(curandDestroyGenerator(curand_generator_));
}
- if (!vsl_stream_) VSL_CHECK(vslDeleteStream(&vsl_stream_));
+ if (vsl_stream_) VSL_CHECK(vslDeleteStream(&vsl_stream_));
};
void Caffe::set_random_seed(const unsigned int seed) {
void Caffe::DeviceQuery() {
cudaDeviceProp prop;
int device;
- CUDA_CHECK(cudaGetDevice(&device));
+ if (cudaSuccess != cudaGetDevice(&device)) {
+ printf("No cuda device present.\n");
+ return;
+ }
CUDA_CHECK(cudaGetDeviceProperties(&prop, device));
printf("Major revision number: %d\n", prop.major);
printf("Minor revision number: %d\n", prop.minor);