Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

UnknownError: IndexError: list index out of range #178

Closed
coderclear opened this issue Apr 25, 2018 · 1 comment
Closed

UnknownError: IndexError: list index out of range #178

coderclear opened this issue Apr 25, 2018 · 1 comment

Comments

@coderclear
Copy link

coderclear commented Apr 25, 2018

you can ignore
DATA_DIRECTORY = '/home/VOCdevkit', I have changed some settings to adapt my dataset.
I have referenced this #151, but this does not work for me. When I set NUM_CLASSES = 21,it can run successfully.
Below is setting:
DATA_DIRECTORY = '/home/VOCdevkit'
DATA_LIST_PATH = 'D:/UBUNTU/github/getdata/train.txt'
GRAD_UPDATE_EVERY = 10
IGNORE_LABEL = 255
INPUT_SIZE = '321,321'
LEARNING_RATE = 2.5e-4
MOMENTUM = 0.9
NUM_CLASSES = 91
NUM_STEPS = 20001
POWER = 0.9
RANDOM_SEED = 1234
RESTORE_FROM = 'D:/UBUNTU/github/tensorflow-deeplab-resnet/model/deeplab_resnet.ckpt'
SAVE_NUM_IMAGES = 1
SAVE_PRED_EVERY = 1000
SNAPSHOT_DIR = 'D:/UBUNTU/github/tensorflow-deeplab-resnet/snapshots/'
WEIGHT_DECAY = 0.0005

parser.add_argument("--not-restore-last", action="store_false",
help="Whether to not restore last (FC) layers.")

Below is Error:
UnknownError: 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)]]

Caused by op 'PyFunc_1', defined at:
File "F:\soft\anaconda\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 223, in
main()
File "F:\soft\anaconda\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 219, in main
kernel.start()
File "F:\soft\anaconda\lib\site-packages\ipykernel\kernelapp.py", line 474, in start
ioloop.IOLoop.instance().start()
File "F:\soft\anaconda\lib\site-packages\zmq\eventloop\ioloop.py", line 162, in start
super(ZMQIOLoop, self).start()
File "F:\soft\anaconda\lib\site-packages\tornado\ioloop.py", line 887, in start
handler_func(fd_obj, events)
File "F:\soft\anaconda\lib\site-packages\tornado\stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "F:\soft\anaconda\lib\site-packages\zmq\eventloop\zmqstream.py", line 440, in _handle_events
self._handle_recv()
File "F:\soft\anaconda\lib\site-packages\zmq\eventloop\zmqstream.py", line 472, in _handle_recv
self._run_callback(callback, msg)
File "F:\soft\anaconda\lib\site-packages\zmq\eventloop\zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "F:\soft\anaconda\lib\site-packages\tornado\stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "F:\soft\anaconda\lib\site-packages\ipykernel\kernelbase.py", line 276, in dispatcher
return self.dispatch_shell(stream, msg)
File "F:\soft\anaconda\lib\site-packages\ipykernel\kernelbase.py", line 228, in dispatch_shell
handler(stream, idents, msg)
File "F:\soft\anaconda\lib\site-packages\ipykernel\kernelbase.py", line 390, in execute_request
user_expressions, allow_stdin)
File "F:\soft\anaconda\lib\site-packages\ipykernel\ipkernel.py", line 196, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File "F:\soft\anaconda\lib\site-packages\ipykernel\zmqshell.py", line 501, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "F:\soft\anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 2717, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "F:\soft\anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 2827, in run_ast_nodes
if self.run_code(code, result):
File "F:\soft\anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('D:/UBUNTU/github/tensorflow-deeplab-resnet/train_msc.py', wdir='D:/UBUNTU/github/tensorflow-deeplab-resnet')
File "F:\soft\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "F:\soft\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/UBUNTU/github/tensorflow-deeplab-resnet/train_msc.py", line 317, in
main()
File "D:/UBUNTU/github/tensorflow-deeplab-resnet/train_msc.py", line 223, in main
labels_summary = tf.py_func(decode_labels, [label_batch, args.save_num_images, args.num_classes], tf.uint8)
File "F:\soft\anaconda\lib\site-packages\tensorflow\python\ops\script_ops.py", line 203, in py_func
input=inp, token=token, Tout=Tout, name=name)
File "F:\soft\anaconda\lib\site-packages\tensorflow\python\ops\gen_script_ops.py", line 38, in _py_func
name=name)
File "F:\soft\anaconda\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op
op_def=op_def)
File "F:\soft\anaconda\lib\site-packages\tensorflow\python\framework\ops.py", line 2628, in create_op
original_op=self._default_original_op, op_def=op_def)
File "F:\soft\anaconda\lib\site-packages\tensorflow\python\framework\ops.py", line 1204, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

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)]]

@coderclear
Copy link
Author

I have solved this issue, just modify label_colours in ulils.py to adapt your dataset.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant