retina-unet icon indicating copy to clipboard operation
retina-unet copied to clipboard

TypeError: __init__() got an unexpected keyword argument 'input_dtype'

Open PiceLao opened this issue 7 years ago • 2 comments

Hi, I am going to test the net, but I get the following error: I am using CUDA8.0, GTX TITAN X GPU, Ubuntu 14.04. root@1f9eab07a59c:~/laocp/keras/retina-unet-master# python run_testing.py

  1. Create directory for the results (if not already existing)

  2. Run the prediction on GPU (no nohup) Using Theano backend. WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL: https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

Using cuDNN version 5105 on context None Mapped name None to device cuda: GeForce GTX TITAN X (0000:01:00.0) Using gpu device 0: GeForce GTX TITAN X (CNMeM is disabled, cuDNN 5105)

the side H is not compatible with the selected stride of 5 img_h 584, patch_h 48, stride_h 5 (img_h - patch_h) MOD stride_h: 1 So the H dim will be padded with additional 4 pixels the side W is not compatible with the selected stride of 5 img_w 565, patch_w 48, stride_w 5 (img_w - patch_w) MOD stride_w: 2 So the W dim will be padded with additional 3 pixels new full images shape: (20, 1, 588, 568)

test images shape: (20, 1, 588, 568)

test mask shape: (20, 1, 584, 565) test images range (min-max): 0.0 - 1.0 test masks are within 0-1

Number of patches on h : 109 Number of patches on w : 105 number of patches per image: 11445, totally for this dataset: 228900

test PATCHES images shape: (228900, 1, 48, 48) test PATCHES images range (min-max): 0.0 - 1.0 Traceback (most recent call last): File "./src/retinaNN_predict.py", line 111, in model = model_from_json(open(path_experiment+name_experiment +'_architecture.json').read()) File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/models.py", line 333, in model_from_json return layer_module.deserialize(config, custom_objects=custom_objects) File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/layers/init.py", line 46, in deserialize printable_module_name='layer') File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object list(custom_objects.items()))) File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 2378, in from_config process_layer(layer_data) File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 2347, in process_layer custom_objects=custom_objects) File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/layers/init.py", line 46, in deserialize printable_module_name='layer') File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 141, in deserialize_keras_object return cls.from_config(config['config']) File "/root/laocp/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 1210, in from_config return cls(**config) TypeError: init() got an unexpected keyword argument 'input_dtype'.

Any idea on how to resolve this problem? Thx for sharing!!

PiceLao avatar Apr 22 '17 14:04 PiceLao

Hi, This code is developed by @lantiga @dcorti , I am learning as you are.

It seems this code error with keras's function 'model_from_json', I think the file which storage the model named 'experiment_name_architecture.json' was broken or missing, then you need to training the model again. Or maybe import not correctly at this time, you can try it again.

And make sure your experiment name in 'configuration.txt' as the same as you want to test.

Please forgive me, have you train the model first? (If you did, please ignore this :) )

hope this can help you.

pythonokai avatar Apr 25 '17 12:04 pythonokai

I have the same issue How did you solve it?

anitstanly avatar Apr 28 '19 19:04 anitstanly