magizbox / python

Python Tutorial and Examples from A to Z
http://magizbox.com/training/python/
GNU General Public License v3.0
2 stars 0 forks source link

U-Net implementation error #3

Closed hiroshiperera closed 6 years ago

hiroshiperera commented 6 years ago

Hi

I'm getting the following error when trying to implement the U-Net model. Can someone help me to solve this issue.

Traceback (most recent call last): File "C:\Python35\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 468, in make_tensor_proto str_values = [compat.as_bytes(x) for x in proto_values] File "C:\Python35\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 468, in str_values = [compat.as_bytes(x) for x in proto_values] File "C:\Python35\lib\site-packages\tensorflow\python\util\compat.py", line 65, in as_bytes (bytes_or_text,)) TypeError: Expected binary or unicode string, got test

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\hiros\Desktop\u-net\Luna2016-Lung-Nodule-Detection-master\Luna2016-Lung-Nodule-Detection-master\UNET\Code\LUNA_unet.py", line 216, in model = train(False) File "C:\Users\hiros\Desktop\u-net\Luna2016-Lung-Nodule-Detection-master\Luna2016-Lung-Nodule-Detection-master\UNET\Code\LUNA_unet.py", line 203, in train accuracy = Accuracy(copy.deepcopy(imgs_test),copy.deepcopy(imgs_mask_test_true)) File "C:\Users\hiros\Desktop\u-net\Luna2016-Lung-Nodule-Detection-master\Luna2016-Lung-Nodule-Detection-master\UNET\Code\LUNA_unet.py", line 162, in init dc = dice_coef(test,pred) File "C:\Users\hiros\Desktop\u-net\Luna2016-Lung-Nodule-Detection-master\Luna2016-Lung-Nodule-Detection-master\UNET\Code\LUNA_unet.py", line 54, in dice_coef y_true = K.flatten(y_true) File "C:\Python35\lib\site-packages\keras\backend\tensorflow_backend.py", line 2106, in flatten return tf.reshape(x, [-1]) File "C:\Python35\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 3937, in reshape "Reshape", tensor=tensor, shape=shape, name=name) File "C:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 513, in _apply_op_helper raise err File "C:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 510, in _apply_op_helper preferred_dtype=default_dtype) File "C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 926, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "C:\Python35\lib\site-packages\tensorflow\python\framework\constant_op.py", line 229, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "C:\Python35\lib\site-packages\tensorflow\python\framework\constant_op.py", line 208, in constant value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "C:\Python35\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 472, in make_tensor_proto "supported type." % (type(values), values)) TypeError: Failed to convert object of type <class 'theano.tensor.var.TensorVariable'> to Tensor. Contents: test. Consider casting elements to a supported type.

rain1024 commented 6 years ago

It may not related to this repository

hiroshiperera commented 6 years ago

I didn't get you.. Is this not the correct place to post this?