kingfengji / gcForest

This is the official implementation for the paper 'Deep forest: Towards an alternative to deep neural networks'
http://lamda.nju.edu.cn/code_gcForest.ashx
1.31k stars 425 forks source link

Train the Fine Grained Forest use the model cifar10 just go [win_utils.get_windows] get_windows_end shows the MemoryError! #9

Closed liu9x closed 6 years ago

liu9x commented 7 years ago

I run the example cifar10 model to train a fine grained Forest,the hardware environment is Ubantu16.04 TLS,pycharm community Edtion,python 2.7,8g memory.When the code run to [win_utils.get_windows] get_windows_start: X.shape=(10000, 3, 32, 32), X_win.shape=(192, 1690000), nw=13, nh=13, c=3, win_x=8, win_y=8, stride_x=2, stride_y=2 [win_utils.get_windows]get_windows_end the terminal shows the following Error: Traceback (most recent call last): File "tools/train_fg.py", line 49, in net.fit_transform(data_train.X, data_train.y, data_test.X, data_test.y, train_config) File "lib/gcforest/fgnet.py", line 53, in fit_transform layer.fit_transform(train_config) File "lib/gcforest/layers/fg_win_layer.py", line 106, in fit_transform keep_model_in_mem=train_config.keep_model_in_mem) File "lib/gcforest/estimators/kfold_wrapper.py", line 98, in fit_transform est.fit(X[train_idx].reshape((-1, n_dims)), y[train_idx].reshape(-1), cache_dir=cache_dir) MemoryError

I will be grateful to those who can answer me where the point is.

kingfengji commented 7 years ago

see issue 10 random forests are not so mem-friendly, You can try set the n_trees or max_depth to a smaller value, or change another computer with large RAM.

kingfengji commented 6 years ago

Please try the new api which is more mem-friendly,