mindspore导出动态bs的air模型报错
收藏回复举报
mindspore导出动态bs的air模型报错
t('forum.solved') 已解决
发表于2024-01-16 09:29:25
0 查看
 

def run_export(): 

def run_export():
    context.set_context(mode=context.GRAPH_MODE, device_target=config.device_target)
    if config.device_target == "Ascend":
        context.set_context(device_id=config.device_id)
    ts_shape = config.testing_shape

    network = YOLOV4CspDarkNet53()
    network.set_train(False)

    param_dict = load_checkpoint(config.ckpt_file)
    load_param_into_net(network, param_dict)

    input_data = Tensor(np.ones([config.batch_size, 3, ts_shape, ts_shape]), mindspore.float32)
    export(network, input_data, file_name=config.file_name, file_format=config.file_format)

config.batch_size = -1时报错:
ValueError: negative dimensions are not allowed 
错误提示应该是不支持负数,请问该如何导出动态bs的air模型呢

我要发帖子