|
- nn.Upsample(size=(x1.size()[2]*2, x1.size()[3]*2), mode='bilinear', align_corners=True)
或者- F.interpolate(x1, size=(x1.size()[2]*2, x1.size()[3]*2), mode='bilinear', align_corners=True)
使用以上两种上采样的pytorch模型总是无法转换成rknn模型,在转换模型的过程中会报如下错误:- --> Config model
- done
- --> Loading model
- ./unet.pt ********************
- E Catch exception when loading pytorch model: ./unet.pt!
- E Traceback (most recent call last):
- E File "rknn\api\rknn_base.py", line 339, in rknn.api.rknn_base.RKNNBase.load_pytorch
- E File "rknn\base\RKNNlib\RK_nn.py", line 146, in rknn.base.RKNNlib.RK_nn.RKnn.load_pytorch
- E File "rknn\base\RKNNlib\app\importer\import_pytorch.py", line 128, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
- E File "rknn\base\RKNNlib\converter\convert_pytorch_new.py", line 2255, in rknn.base.RKNNlib.converter.convert_pytorch_new.convert_pytorch.load
- E File "rknn\base\RKNNlib\converter\convert_pytorch_new.py", line 2370, in rknn.base.RKNNlib.converter.convert_pytorch_new.convert_pytorch.parse_nets
- E File "rknn\base\RKNNlib\converter\convert_pytorch_new.py", line 2059, in rknn.base.RKNNlib.converter.convert_pytorch_new.PyTorchOpConverter.convert_operators
- E File "rknn\base\RKNNlib\converter\convert_pytorch_new.py", line 1439, in rknn.base.RKNNlib.converter.convert_pytorch_new.PyTorchOpConverter.size
- E File "rknn\base\RKNNlib\core\shape.py", line 42, in rknn.base.RKNNlib.core.shape.Shape.reset_shape_format
- E File "rknn\base\RKNNlib\core\shape.py", line 86, in rknn.base.RKNNlib.core.shape.Shape.format
- E TypeError: '>=' not supported between instances of 'Tensor' and 'int'
- Load Pytorch model failed!
请问大佬们这个错误该如何解决,或者这个上采样的函数有可替换的吗?
|
|