pytorch2keras icon indicating copy to clipboard operation
pytorch2keras copied to clipboard

IndexError: list index (1) out of range

Open Brave731 opened this issue 5 years ago • 2 comments

Describe the bug DEBUG:onnx2keras:Converting ONNX operation DEBUG:onnx2keras:type: Cast DEBUG:onnx2keras:node_name: 353 DEBUG:onnx2keras:node_params: {'to': 1, 'change_ordering': True, 'name_policy': 'short'} DEBUG:onnx2keras:... DEBUG:onnx2keras:Check if all inputs are available: DEBUG:onnx2keras:Check input 0 (name 351). DEBUG:onnx2keras:... found all, continue

.local/lib/python3.6/site-packages/onnx2keras/operation_layers.py in convert_cast(node, params, layers, node_name, keras_name) 232 233 --> 234 if is_numpy(layers[node.input[0]]) and is_numpy(layers[node.input[1]]): 235 logger.debug('Cast numpy array') 236

IndexError: list index (1) out of range

To Reproduce Snippet of your code

Expected behavior A clear and concise description of what you expected to happen.

Logs If applicable, add error message to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Python [e.g. Python 2, Python 3]
  • Version [e.g. v0.1.11]

Additional context Add any other context about the problem here.

Brave731 avatar Nov 15 '19 02:11 Brave731

The problem appears in upsampling_bilinear。

Brave731 avatar Nov 15 '19 02:11 Brave731

Yes, I meet this bug too.

It seems that something is wrong with the code logic. The code asserts that the length of the input node is 1, but then writes down "node.input [1]". really confusing

Qianyu97 avatar Nov 26 '19 08:11 Qianyu97