|
8#
楼主 |
发表于 2021-8-27 10:08:50
|
只看该作者
我现在正常量化一个torch1.6训练的更改focus层的yolov5模型 也是报
TypeError: Input 'y' of 'Add' Op has type int32 that does not match type float32 of argument 'x'.
错误位置在
ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int32: 'Tensor("var_at_input.18_7_8_1/cond/Merge:0", shape=(1, 1, 1, 1), dtype=int32, device=/device:CPU:0)'
这个问题,但是我无法定位到哪里出错,我的设置:
rknn = RKNN()
# pre-process config
print('--> config model')
rknn.config(
mean_values=[[0.0, 0.0, 0.0]],
std_values=[[255., 255., 255.]],
reorder_channel='1 2 0', # bgr2rgb
target_platform='rv1126',
)
print('done')
# Load pytorch model
print('--> Loading model')
ret = rknn.load_pytorch(model=model_path, input_size_list=input_size_list)
if ret != 0:
print('Load pytorch model failed!')
exit(ret)
print('done')
# Build model
print('--> Building model')
ret = rknn.build(do_quantization=False, dataset='./dataset_640.txt')
if ret != 0:
print('Build pytorch failed!')
exit(ret)
print('done')
基本没错吧,我把do_quantization=True就报上面的问题,麻烦您帮我看一下 |
|