LinHungShi / GCNetwork

118 stars 39 forks source link

Loading trained model #5

Open Lejboelle opened 7 years ago

Lejboelle commented 7 years ago

Hi, I've been trying to use your re-implementation, although, I stumbled across a couple errors. First, I got the "'module' object has no attribute 'conv3d_transpose'", I fixed it copying your function to the tensorflow_backend library (I assumed you have done the same?) Maybe could be an idea to include a comment about this in the readme (to people relatively new to keras)?

Second, when trying to load your pretrained model, I got the error: TypeError: Output tensors to a Model must be Keras tensors. Found: <keras.engine.training.Model object at 0x7fbcef09f450>

I fixed it by commenting line 28 in the main.py as it seems this line loads a model based on an already loaded model? Finally, I wanted to ask which architecture you used for your pre-trained model and if it is supposed be used 'out-of-the-box'? Since it contains 107 layers.

Best,

LinHungShi commented 7 years ago

I didn't copy functions to the backend library. Could you post the error message ? The pretrained model is only for experiment, it should have been deleted.

Lejboelle commented 7 years ago

This is the error I get if I don't copy the function:

Traceback (most recent call last): File "code/main.py", line 48, in trainModel(train_data = [limages, rimages, gtimages], callbacks = callbacks, weight_path = weight_path, lr = args.learning_rate, epochs = args.epochs, batch_size = args.batch_size, val_data = val_data) File "/home/asrl/ErhvervsPhd/Kode/Repositories/GCNetwork-master/code/network_utils.py", line 24, in trainModel model = createGCNetwork(left_img, right_img) File "/home/asrl/ErhvervsPhd/Kode/Repositories/GCNetwork-master/code/gcnetwork.py", line 154, in createGCNetwork disp_map = LearnReg(cv) File "/home/asrl/ErhvervsPhd/Kode/Repositories/GCNetwork-master/code/gcnetwork.py", line 141, in LearnReg deconv = createDeconv3D(up_convs, 2 * BASE_NUM_FILTERS, strides = 2) File "/home/asrl/ErhvervsPhd/Kode/Repositories/GCNetwork-master/code/gcnetwork.py", line 48, in createDeconv3D deconv = Conv3DTranspose(filters = filters, kernel_size = kernel_size, strides = strides, data_format = data_format, padding = padding) (input) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 596, in call output = self.call(inputs, **kwargs) File "/home/asrl/ErhvervsPhd/Kode/Repositories/GCNetwork-master/code/conv3dTranspose.py", line 225, in call outputs = K.conv3d_transpose( AttributeError: 'module' object has no attribute 'conv3d_transpose'

heyalqh commented 7 years ago

@LinHungShi Hi, LinHung Shi , Did you train the model on kitti?

LinHungShi commented 7 years ago

@Lejboelle I have modified convolution3DTranspose.py. Feel free to tell my If you still got problems @heyalqh No I haven't. I run out of memory with original parameter setting. It seems to have at least 12G in order to fit data into memory.