Monday, July 27, 2015

Working with Torch7 in Ubuntu 14.04


Training an Object Classifier in Torch-7 on multiple GPUs over ImageNet
https://github.com/e-lab/train-net-master-multiGPU
https://github.com/facebook/fbcunn/tree/master/examples/imagenet


How to retrain a trained model with more detailed information?https://groups.google.com/forum/#!topic/torch7/nuecUMknfSg

Negative loss when finetune model that is loaded using loadcaffe
https://gitter.im/torch/torch7/archives/2015/03/26

@szagoruyko does loadcaffe still work with the latest caffe models? i'm getting "Message type "caffe.NetParameter" has no field named "layer"" ... it doesn't error out, but the result is negative loss function evaluations     
@patrickhop these have to work. do you remove softmax and put logsoftmax instead?     
do you want to fine-tune? If you know how to use torch, fine-tuning is pretty natural, there's nothing you have to do special except initialize with a pre-trained model (available via loadcaffe)

How to get a layer from a caffe model using torch?
http://stackoverflow.com/questions/28171577/how-to-get-a-layer-from-a-caffe-model-using-torch

GoogleNet not training?
https://github.com/soumith/imagenet-multiGPU.torch/issues/2
Add batch normalization or initialize weights with Xavier technique
How to load trained weights?
https://groups.google.com/forum/#!topic/torch7/fcy0-5v6M08
https://github.com/soumith/cuda-convnet2.torch/tree/master/examples

How to retrain a trained model with more detailed information?
https://groups.google.com/forum/#!topic/torch7/nuecUMknfSg

Clean up before saving torch model
https://github.com/torch/DEPRECEATED-torch7-distro/issues/47


Install fbcunn

      Workaround for installing fbthrift

- Install https://github.com/facebook/fbthrift manually
- Use folly v.047.0 as advised in deps.sh
- Remember to 'sudo make install' and 'sudo ldconfig' after folly was 'make'
- Edit file configure:
     from
 fi 
    succeeded=no
    if test "x$want_folly" = "xyes"; then
      to
 fi 
    succeeded=yes
    if test "x$want_folly" = "xyes"; then
- Edit files in thrift/lib/cpp2:
         BinaryProtocol.h
         BinaryProtocol.cpp
         CompactProtocol.h
//DECLARE_int32(thrift_cpp2_protocol_reader_string_limit);
//DECLARE_int32(thrift_cpp2_protocol_reader_container_limit);
extern int FLAGS_thrift_cpp2_protocol_reader_string_limit;
extern int FLAGS_thrift_cpp2_protocol_reader_container_limit;

      in thrift/lib/cpp/util/kerberos:
         Krb5CredentialsCacheManager.cpp
#ifndef NO_LIB_GFLAGS
//DEFINE_string(
//  thrift_cc_manager_kill_switch_file,
//  "/var/thrift_security/disable_cc_manager",
//  "A file, which when present, acts as a kill switch for and disables the cc "
//  " manager thread running on the host.");
std::string FLAGS_thrift_cc_manager_kill_switch_file="/var/thrift_security/disable_cc_manager";
#else
   For more information:
   https://google-gflags.googlecode.com/svn/trunk/doc/gflags.html#declare
   https://google-gflags.googlecode.com/svn/tags/gflags-0.1/src/google/gflags.h.in

- Do 'make' and 'sudo make install' and 'sudo ldconfig' in fbthrift/thrift
               


Error 1:

Error: Failed installing dependency: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luacrypto-0.3.2-1.src.rock - Could not find expected file openssl/evp.h, or openssl/evp.h for OPENSSL -- you may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command. Example: luarocks install luacrypto OPENSSL_DIR=/usr/local


Fix 2:

sudo apt-get install libssl1.0.0 libssl-dev

Error 2:
th> require 'cudnn'...ubuntu/torch-distro/install/share/lua/5.1/trepl/init.lua:319: .../ubuntu/torch-distro/install/share/lua/5.1/cudnn/ffi.lua:385: /usr/local/cuda/lib64/libcudnn.so: undefined symbol: cudnnGetVersion
Checked /usr/local/cuda/lib64/libcudnn.so, it does exist and seems nothing wrong.

Fix 2:

You downloaded cudnn R1. The bindings are for cudnn R2. Download R2 and you won't see this error.
https://groups.google.com/forum/#!topic/torch7/vhgk8fGa7Ic 

Error 3:
field weight is not a torch.CudaTensor

Fix3:
The model's type is not the same as the input type in my case.
model = model:cuda()
input = input:cuda()
output = model:forward(input)
https://groups.google.com/forum/#!topic/torch7/gq1x6t_TJ7g

Error 4:
libGraphicsMagickWand.so: cannot open shared object file: No such file or directory

Fix 4:
Install graphicsmagick lib:sudo apt-get install libgraphicsmagick1-dev
https://github.com/eladhoffer/ImageNet-Training/issues/4

No comments:

Post a Comment