gmalivenko / pytorch2keras

PyTorch to Keras model convertor
https://pytorch2keras.readthedocs.io/en/latest/
MIT License
858 stars 144 forks source link

IndexError: list index (1) out of range #100

Open Brave731 opened 4 years ago

Brave731 commented 4 years ago

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

Additional context Add any other context about the problem here.

Brave731 commented 4 years ago

The problem appears in upsampling_bilinear。

Qianyu97 commented 4 years ago

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