Prechádzať zdrojové kódy

corrected merging issue with multiple users in init script

Alexander Freytag 8 rokov pred
rodič
commit
83ec8045c1
2 zmenil súbory, kde vykonal 11 pridanie a 4 odobranie
  1. 4 1
      caffe_load_network.m
  2. 7 3
      initWorkspaceCaffeTools.m

+ 4 - 1
caffe_load_network.m

@@ -38,7 +38,10 @@ function [net, mean_data] = caffe_load_network ( s_pathtodeployfile, s_pathtomod
     end
     
     %% load mean image and adapt to network input size
-    mean_data  = caffe.io.read_mean( s_meanfile );
+    load ( s_meanfile, 'mean_data' );
+    % note: old caffe versions needed the explicit function:
+    %mean_data  = caffe.io.read_mean( s_meanfile );
+    
     % crop center from mean file according to network size
     i_sizeMean = size( mean_data );
     offset_row = floor ( int32( i_sizeMean(1)-i_currentNetInputSize(1) ) / 2 ) + 1;

+ 7 - 3
initWorkspaceCaffeTools.m

@@ -17,9 +17,9 @@ function initWorkspaceCaffeTools
 % 
 
 
-
     %% setup paths of 3rd-party libraries in a user-specific manner
 
+    
     CAFFEDIR            = [];
 
         
@@ -29,8 +29,6 @@ function initWorkspaceCaffeTools
         
         s_dest_caffebuild     = sprintf( '/home/freytag/lib/caffe_%s/matlab/', s_hostname );    
         CAFFEDIR              = s_dest_caffebuild;       
-        %note: temporary usage of marcels recent caffe version
-        %CAFFEDIR              = '/home/simon/Research/lib/caffe.current/matlab/';
     elseif strcmp( getenv('USER'), 'rodner')
         [~, s_hostname]       = system( 'hostname' );
         s_hostname            = 'pollux';%s_hostname ( 1:(length(s_hostname)-1) ) ;
@@ -43,9 +41,15 @@ function initWorkspaceCaffeTools
                         
         s_dest_caffebuild     = sprintf( '/home/freytag/lib/caffe_%s/matlab/', s_hostname );    
         CAFFEDIR              = '/home/simon/Research/lib/caffe.current/matlab/';%s_dest_caffebuild;
+    elseif strcmp( getenv('USER'), 'alex') 
+        CAFFEDIR              = '/home/alex/lib/caffe/matlab/';
     else          
         fprintf('Unknown user %s and unknown default settings', getenv('USER') ); 
     end
+    
+    %% make path to caffe known as global variable
+    global s_path_to_caffe;
+    s_path_to_caffe     = CAFFEDIR;      
 
     %% add paths which come with this repository