Open Brave731 opened 4 years ago
Hello @Brave731.
Unfortunately, the converter doesn't support upsample_bilinear
for now due to very different results for the same parameters using PyTorch and Tensorflow.
But you can replace your Bilinear upsample with ConvTranspose2d for example.
@nerox8664 Thanks for your reply, the model can be converted。
How did you convert it successfully? By replacing upsample_bilinear with ConvTranspose2d? @Brave731
@xiaozhi2015 转换后结果不一致
@xiaozhi2015 @Brave731 you may need to fine-tune you model (or at least to train inserted ConvTranspose2d layer) after replacing upsampling method. For some models you will get very similar results, but it depends on your ConvTranspose2d parameters and network architecture.
Code: z = F.upsample(y, size=y.size()[2:], mode='bilinear')
Traceback (most recent call last): File ".\test.py", line 43, in
k_model = converter.pytorch_to_keras(model, input_var, [(3, 224, 224)], verbose=True)
File "D:\Python36\lib\site-packages\pytorch2keras\converter.py", line 73, in pytorch_to_keras
verbose=verbose, change_ordering=change_ordering)
File "D:\Python36\lib\site-packages\onnx2keras\converter.py", line 174, in onnx_to_keras
keras_names
File "D:\Python36\lib\site-packages\onnx2keras\operation_layers.py", line 234, in convert_cast
if is_numpy(layers[node.input[0]]) and is_numpy(layers[node.input[1]]):
IndexError: list index (1) out of range