-
Notifications
You must be signed in to change notification settings - Fork 430
py_func: list out of range #151
Comments
where does that occur exactly? more information would be helpful |
Hi, I just met the similar problem. It occurs when I change to use my own dataset, which I have already processed following the instruction. The error is : (there are 47 categories in my new dataset) Here is the setting: Do you have any idea about this problem? Thank you for your potential help! |
I just met the similar problem. I think it's occur when using different num of class dataset.. I'm using 32 categories in my dataset. Could you help me? And Thank you shared code :) @DrSleep |
Oh! I solved it! @SharonZhu @yuchuochuo1023
In the error log.. included
So, the session that in deeplab_model.py gt_decoded_labels = tf.py_func(preprocessing.decode_labels, [labels, params['batch_size'], params['num_classes']], tf.uint8) and function [decode_labels] at preprocessing.py for i in range(num_images):
img = Image.new('RGB', (len(mask[i, 0]), len(mask[i])))
pixels = img.load()
for j_, j in enumerate(mask[i, :, :, 0]):
for k_, k in enumerate(j):
if k < num_classes: <<<<<< Here is problem!!!
pixels[k_, j_] = label_colours[k]
outputs[i] = np.array(img) In conclusion, |
which is written in README, if you read it carefully: https://github.com/DrSleep/tensorflow-deeplab-resnet#using-your-dataset |
When I started to run train.py, an error occurred:
UnknownError (see above for traceback): IndexError: list index out of range
[[Node: PyFunc_1 = PyFunc[Tin=[DT_UINT8, DT_INT32, DT_INT32], Tout=[DT_UINT8], token="pyfunc_1", _device="/job:localhost/replica:0/task:0/cpu:0"](create_inputs/batch:1, PyFunc_1/input_1, PyFunc_1/input_2)]]
It seemed that the py_func used in summary part has some problems. Could someone help me handle it? Thanks a lot.
The text was updated successfully, but these errors were encountered: